mysql问题:ERROR 1045 (28000): Access denied for user &a_MySQL
程序员文章站
2022-04-18 16:23:00
...
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.
推荐阅读
-
winxp 安装MYSQL 出现Error 1045 access denied 的解决方法
-
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
-
新装MySql后登录出现root帐号提示mysql ERROR 1045 (28000): Access denied for use的解决办法
-
解决mysql ERROR 1045 (28000)-- Access denied for user问题
-
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
-
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
-
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
-
新装MySql后登录出现root帐号提示mysql ERROR 1045 (28000): Access denied for use的解决办法
-
解决mysql ERROR 1045 (28000)-- Access denied for user问题
-
win10下MySQL 8.0登录Access denied for user‘root’@‘localhost’ (using password: YES)问题的解决方法