您的位置:首页 > 数据库 > MySQL

新装mysql数据库登陆不上去(账号密码正确)

2017-03-23 18:25 309 查看
Open & Edit
/etc/my.cnf


Add
skip-grant-tables
under
[mysqld]


Restart Mysql

You should be able to login to mysql now using the below command
mysql -u root -p


Run
mysql> flush privileges;


Set new password by
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';


Go back to /etc/my.cnf and remove/comment skip-grant-tables

Restart Mysql

Now you will be able to login with the new password
mysql -u root -p
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐