剛剛碰到了怪事, 在命令列下無法登入 mysql  驚訝

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

這樣就可以正常登入了  奸笑 奸笑

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 mybeauty 的頭像
    mybeauty

    只是記事本

    mybeauty 發表在 痞客邦 留言(0) 人氣()