1.1检查是否安装了mysqlnode
rpm -qa |grep mysql
1.2卸载mysql
rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
一步到位sql
rpm -e --nodeps $(rpm -qa |grep mysql)
cd mysql rpm -ivh *.rpm
service mysql start
cat /root/.mysql_secret # The random password set for the root user at Mon Jul 23 23:39:24 2018 (local time): 3BwgPfmuGCIPISFc //随机密码
mysql -uroot -p3BwgPfmuGCIPISFc //明文登录
mysql> SET PASSWORD = PASSWORD('新的密码');
mysql> grant all privileges on *.* to 'root' @'%' identified by '上面设置的密码'; mysql> flush privileges;
//添加到开机启动项 chkconfig --add mysql //开机启动 chkconfig mysql on //检查是否添加成功 chkconfig