首頁  >  文章  >  資料庫  >  mysql问题:ERROR 1045 (28000): Access denied for user &a_MySQL

mysql问题:ERROR 1045 (28000): Access denied for user &a_MySQL

WBOY
WBOY原創
2016-06-01 13:08:331077瀏覽

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.

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn