mysql问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
2014-06-18 18:17
621 查看
First things first. Log in as root and stop the mysql daemon.
sudo /etc/init.d/mysql stop
Now lets start up the mysql daemon and skip the grant tables which store the passwords.
sudo mysqld_safe --skip-grant-tables&
(press Ctrl+C now to disown the process and start typing commands again)
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.
sudo mysql --user=root mysql
update user set Password=PASSWORD('new-password')
flush privileges
exit
Now kill your running mysqld then restart it normally.
sudo killall mysqld_safe&
(press Ctrl+C now to disown the process and start typing commands again)
/etc/init.d/mysql start
You should be good to go. Try not to forget your password again.
sudo /etc/init.d/mysql stop
Now lets start up the mysql daemon and skip the grant tables which store the passwords.
sudo mysqld_safe --skip-grant-tables&
(press Ctrl+C now to disown the process and start typing commands again)
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.
sudo mysql --user=root mysql
update user set Password=PASSWORD('new-password')
flush privileges
exit
Now kill your running mysqld then restart it normally.
sudo killall mysqld_safe&
(press Ctrl+C now to disown the process and start typing commands again)
/etc/init.d/mysql start
You should be good to go. Try not to forget your password again.
相关文章推荐
- MySQL登录 ERROR 1045 (28000) Access denied for user 'root'@'localhost' (using password NO)问题
- mysql问题ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 解决MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO))
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- MySql 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).问题解决方案
- MySQL: Error 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
- centOS下mysql-ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- MySQL的启动问题 (ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO))
- mysql提示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- mysql-->ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 解决数据库连接报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- mysql中出现 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的解决办法
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- CentOS下进入MySQL提示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- mysql解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- CentOS 命令登录MySQL时,报错 ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)