Access denied for user: 'root@localhost' (Using password: YES)

centos 设备mysql成功后

首次使用root登录发生:Access denied for user: 'root@localhost' (Using password: YES)  

因为mysql初始db中间mysql库user表rootpassword是空的

所以,你需要改变rootpassword

首先运行:mysql -u root 

进mysql 图书馆命令行

然后进入mysql库:use mysql;

进入再改就可以运行密码:update user set password=password('aaa') where user='root'

版权声明:本文博客原创文章。博客,未经同意,不得转载。

原文地址:https://www.cnblogs.com/mengfanrong/p/4756467.html