1 頁 (共 1 頁)

[MySQL] Access denied !!

發表於 : 2013-03-22, 21:54
tony
ERROR 1045 (28000): Access denied for user '=root'@'localhost' (using password: YES)

系統是 Ubuntu 8.041 server + MySQL

密碼是安裝 Ubuntu 系統時設定的

但是用 phpMyAdmin - 2.11.3deb1ubuntu1 但可以正確登入 @@

不過問題已解決, 解決方式如下..

# service mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[5523]: started

# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


進去了, 再設定一次密碼..

mysql> UPDATE user SET Password=PASSWORD('xxxxxxxxxxxxxxx') where USER='root';
mysql> FLUSH PRIVILEGES;

mysql> \q

# service mysqld restart

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> \q