第十二步,启动MySQL,如果出现SUCCESS,恭喜您,MySQL启动成功;如果出错,不要着急,根据日志排查错误
[root@serv01 mysql-5.5.29]#/etc/init.d/mysqld start Starting MySQL.. SUCCESS! [root@serv01 mysql-5.5.29]# ll/usr/local/mysql/data/ -d drwxr-xr-x. 5 mysql mysql 4096 Sep 4 23:39 /usr/local/mysql/data/
第十三步,添加环境变量,并使其生效
[root@serv01 mysql-5.5.29]# vim~/.bash_profile [root@serv01 mysql-5.5.29]# . !$ . ~/.bash_profile [root@serv01 mysql-5.5.29]# cat ~/.bash_profile| grep PATH PATH=/usr/local/mysql/bin/:$PATH:$HOME/bin export PATH
第十四步,登录mysql,查看版本,如果出现版本号,则证明安装成功
[root@serv01 mysql-5.5.29]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.29-log Sourcedistribution Copyright (c) 2000, 2012, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or its affiliates. Other names may be trademarks oftheir respective owners. Type 'help;' or '\h' for help. Type '\c' toclear the current input statement. mysql> select version(); +------------+ | version() | +------------+ | 5.5.29-log | +------------+ 1 row in set (0.00 sec) mysql> exit Bye
如果需要安装多个MySQL,需要修改端口,修改sock文件
[root@serv01 mysql-5.5.29]# cat /etc/my.cnf |grep -e sock -e port port =3306 socket =/tmp/mysql.sock
更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10
