版本:mysql-5.1.45-solaris10-i386.tar.gz 下载地址:http://mysql.mirrors.adc.am/Downloads/MySQL-5.1/mysql-5.1.45-solaris10-i386.tar.gz 先将MySQL包传到solaris的/usr/local目录下
下面开始安装: [root@boway:/]# groupadd mysql [root@boway:/]# useradd -d /opt/mysql -g mysql -m mysql [root@boway:/]# cd /usr/local [root@boway:/usr/local]# gunzip < mysql-5.1.45-solaris10-i386.tar.gz | tar -xvf - [root@boway:/usr/local]#ln -s mysql-5.1.45-solaris10-i386 mysql [root@boway:/usr/local]#cd mysql [root@boway:/usr/local/mysql]#./scripts/mysql_install_db --user=mysql Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h boway password 'new-password' Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default.
This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! [root@boway:/usr/local/mysql]# 安装完成以后,设置目录权限,否则mysql将无法启动 [root@boway:/usr/local/mysql]#chown -R root . [root@boway:/usr/local/mysql]#chown -R mysql data [root@boway:/usr/local/mysql]#chgrp -R mysql . 启动数据库服务 [root@boway:/usr/local/mysql]#./bin/mysqld_safe --user=mysql & [1] 964 [root@boway:/usr/local/mysql]#100418 13:42:28 mysqld_safe Logging to '/usr/local/mysql-5.1.45-solaris10-i386/data/boway.err'. 100418 13:42:28 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.45-solaris10-i386/data 设置mysql root用户的密码 [root@boway:/usr/local/mysql]#./bin/mysqladmin -u root password 'root' 进入mysql数据库 [root@boway:/usr/local/mysql]#./bin/mysql -uroot -proot Welcome to the MySQL monitor.
Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.45 MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 将mysql/bin目录添加进系统PATH变量中,这样随处都可以运行mysql命令 [root@boway:/usr/local/mysql]#vi /etc/profile 在/etc/profile文件末尾加入 PATH=/usr/local/mysql/bin:$PATH export PATH 再执行一次上面两条命令即可 查看mysql运行状态 [root@boway:/]#mysqladmin -uroot -proot version mysqladmin
Ver 8.42 Distrib 5.1.45, for pc-solaris2.10 on i386 Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version
5.1.45 Protocol version
10 Connection
Localhost via UNIX socket UNIX socket
/tmp/mysql.sock Uptime:
5 min 27 sec Threads: 1
Questions: 7
Slow queries: 0
Opens: 15
Flush tables: 1
Open tables: 8
Queries per second avg: 0.21 [root@boway:/]# 关闭mysql服务 [root@boway:/]#mysqladmin -uroot -proot shutdown 100418 13:48:39 mysqld_safe mysqld from pid file /usr/local/mysql-5.1.45-solaris10-i386/data/boway.pid ended [1]+
Done
./bin/mysqld_safe --user=mysql
(wd: /usr/local/mysql) (wd now: /) [root@boway:/]# 重启mysql服务 [root@boway:/]#mysqld_safe --user=mysql & |