解决LinuxMysql1045错误ERROR 1045 (28000): Accessdenied for user ‘root‘@‘localhost‘ (using password: YES)
·
错误截图
解决方法
1.打开
vi /etc/my.cnf 找到[mysqld]段,并加入一行“skip-grant-tables”

2 . 输入:wq保存并退出
重启数据库服务
systemctl restart mysqld
3. 进入数据库,免密码
mysql -uroot -p
4.
use mysql; update mysql.user set authentication_string=password('新密码') where user='root'and Host ='localhost'; flush privileges; quit;5.再次重启mysql服务 service mysql restart,使用新的密码登陆,修改成功
更多推荐


所有评论(0)