MySQL的root管理者設定密碼的問題!!! - Linux

Table of Contents


鳥哥的網址
http://linux.vbird.org/linux_server/0360apache.php


[root@linux ~]# /etc/init.d/mysqld start
# 如果是初次使用這個指令來啟動,你的 /var/lib/mysql 會建立資料庫。

[root@linux ~]# netstat -tuln | grep ':3306'
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

# 底下在測試看能否以手動的方式連上 MySQL 資料庫!
[root@linux ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.20

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

mysql> quit
Bye


以上這部分已經順利完成


問題是出在下面部分

鳥哥版的是如此

[root@linux ~]# mysqladmin -u root password 'your.password'
# 從此以後 MySQL 的 root 帳號就需要密碼了!如下所示:

[root@linux ~]# mysql -u root -p
Enter password: <==你必須要在這裡輸入剛剛建立的密碼!
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.20

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

mysql>quit


但我的版本卻是如此

[root@124-8-89-25 ~]# mysqladmin -u root password 'your.password'
[root@124-8-89-25 ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'
(using password: YES)

密碼我也有打哩
然後按下Enter鍵
出來的卻不一樣
麻煩各位高手解惑哩

--

All Comments

Oscar avatarOscar2010-07-11
你手指key進去的密碼一定不是 "your.password" 吧
Ida avatarIda2010-07-14
Enter password: 這部分不是要打我自己想設得密碼嗎????
Caroline avatarCaroline2010-07-16
我了解你的意思哩.......哈哈...我一直想說照著做