mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localho

一、mysql登录错误


mysqladmin: connect to server at 'localhost' failed


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


解决办法:破解mysql密码


1>停止mysql服务:service mysqld stop


2>执行命令:> mysqld_safe --skip-grant-tables & mysql -uroot -p 回车进入


            > use mysql;


            > update user set password=PASSWORD("newpass")where user="root";


          更改密码为 newpass


            > flush privileges; 更新权限


            > quit 退出


3>重启mysql服务:service mysqld restart


4>链接数据库:mysql -uroot -p 新密码

你可能感兴趣的:(mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localho)