5、初始化数据库
[root@localhost MySQL-5.0.56]# /usr/local/mysql/bin/mysql_install_db --user=mysql
The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/local/mysql/bin/mysqlbug script!
[root@localhost mysql-5.0.56]# chown -R root.mysql /usr/local/mysql/
[root@localhost mysql-5.0.56]# chown -R mysql /usr/local/mysql/var/
6、调整lib库路径
[root@localhost mysql-5.0.56]# echo "/usr/local/mysql/lib/mysql/" >> /etc/ld.so.conf
[root@localhost mysql-5.0.56]# ldconfig
7、使用mysqld_safe脚本安全启动服务
[root@localhost mysql-5.0.56]# /usr/local/mysql/bin/mysqld_safe --user=mysql &
[2] 7657
8、将mysqld 添加为系统服务
[root@localhost mysql-5.0.56]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.0.56]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.0.56]# chkconfig --add mysqld
[root@localhost mysql-5.0.56]# chkconfig mysqld on
9、设置Mysql的执行路径
[root@localhost mysql-5.0.56]# export PATH=$PATH:/usr/local/mysql/bin/
[root@localhost mysql-5.0.56]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
10、安装完成、登陆测试
[root@localhost mysql-5.0.56]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.56-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
