mysql5.7 设置密码

5.7版本的MYSQL的用户表的密码字段与以往版本有所区别, 不再是password字段 而是authentication_string字段。

请注意修改密码:

vim  /opt/mysql_d/mysql001/mysql.cnf

在[mysqld]处,添加以下;

skip-name-resolve

skip-grant-tables

保存退出;

进入数据库;

mysql -uroot -p

use mysql;

update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';

 或者 set password for 'root'@'localhost'=password('密码');

猜你喜欢

转载自www.cnblogs.com/ipyanthony/p/9289541.html
今日推荐