安装完mysql后,登录提示密码不对
然后使用mysqladmin提示登录失败:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
解决办法:
1,service mysqld stop
2,mysqld_safe --skip-grant-tables &
3,mysql -uroot -p 回车进入
>use mysql;
> update user set password=PASSWORD("newpass")where user="root";
> flush privileges;
> quit
service mysqld restart
mysql -uroot -p新密码 进入