您的位置:首页 > 运维架构 > Linux

centos 安装 mysql5.7.9初始密码问题

2016-06-06 18:13 477 查看
mysql5.7.9在安装完成后会,root用户会产生一个不为空的初始密码,登陆mysql就会产生问题了,有必要修改一下登陆密码:

这是从网上找的一个方法,加以总结得出来的,亲测可以:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql>update mysql.user set authentication_string=password('321321') where user='abc' and Host = 'localhost';

mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: