【1】上传安装文件mysql-5.0.51a-solaris10-i386.tar.gz
我放在了/smbshare下
-bash-3.00# /usr/sfw/bin/gtar -zxvf mysql-5.0.51a-solaris10-i386.tar.gz 解压
【2】安装
-bash-3.00# groupadd mysql
-bash-3.00# useradd -g mysql mysql
-bash-3.00# cd /usr/local/
-bash-3.00# ln -s /smbshare/mysql-5.0.51a-solaris10-i386 mysql 将原MySQL目录链接到/usr/local下
-bash-3.00# cd mysql
-bash-3.00# chown -R mysql . 改变MySQL目录属主
-bash-3.00# chgrp -R mysql . 改变MySQL目录属组
-bash-3.00# scripts/mysql_install_db --user=mysql 创建MySQL数据字典和初始化授权表
-bash-3.00# chown -R root . 将其他的文件属主改回root
-bash-3.00# chown -R mysql data/ 将data目录属主改为MySQL
安装就完成了
如果你想要MySQL在系统启动时自动启动,可以进行一下步骤。
-bash-3.00# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/
-bash-3.00# ln -s /usr/local/mysql/support-files/mysql.server /etc/rc3.d/S99mysql
-bash-3.00# ln -s /usr/local/mysql/support-files/mysql.server /etc/rc0.d/K01mysql
【3】测试
启动MySQL服务
-bash-3.00# /usr/local/mysql/bin/mysqld_safe --user=mysql &
设置root用户登录MySQL密码
-bash-3.00# /usr/local/mysql/bin/mysqladmin -u root password root
修改密码
-bash-3.00# /usr/local/mysql/bin/mysqladmin -uroot password abc -p
Enter password:
连接MySQL
-bash-3.00# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a MySQL Community Server (GPL)
![](https://ucenter.51cto.com/images/noavatar_middle.gif)
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M