查看随机密码(数据库版本不同,该步骤会有差异) [root@purecentos Linux]# cat /root/.mysql_secret # The random password set for the root user at Wed Dec 30 08:18:47 2015 (local time): IlYDRZCs
允许远程登陆 mysql> use mysql; mysql> selecthost,user,password from user; mysql> update user setpassword=password('123456') where user='root'; mysql> update user sethost='%'where user='root'and host='localhost'; mysql> flush privileges; mysql> exit
设置开机自启动 [root@purecentos Linux]# chkconfig mysql on [root@purecentos Linux]# chkconfig --list | grep mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off