問題描述
我是 MySQL 的新手,我正在嘗試在我的 Windows 桌面上運行 WordPress,它需要 MySQL.
I'm new to MySQL, I'm trying to run WordPress in my Windows desktop and it needs MySQL.
我使用 Microsoft 提供的 Web Platform Installer
安裝所有內容.我從來沒有為 MySQL 設置過 root 密碼,在安裝 WordPress 的最后一步,它要求輸入 MySQL 服務器密碼.
I install everything with Web Platform Installer
which is provided by Microsoft. I never set a root password for MySQL and in the final step of installing WordPress, it asks for a MySQL server password.
root 的默認密碼是多少(如果有的話)以及如何修改?
What is the default password for root (if there is one) and how to change it?
我試過了:
mysql -u root password '123'
但它顯示給我:
Access denied for user 'root@localhost' (using password:NO)
在此之后我嘗試:
mysql -u root -p
但是,它要求輸入密碼,而我沒有.
However, it asks for a password which I don't have.
更新:按照 Bozho 的建議,我做了以下事情:
Update: as Bozho suggested, I did the following:
- 我從 Windows 服務中停止了 MySQL 服務
- 打開CMD
- 將位置更改為 c:\program files\mysql\bin
執行下面的命令
- I stopped the MySQL Service from Windows services
- Opened CMD
- Changed the location to c:\program files\mysql\bin
Executed the command below
mysqld --defaults-file="C:\\program files\\mysql\\mysql server 5.1\\my.ini" --init-files=C:\\root.txt
該命令運行時出現了關于我在下面提到的字符集的警告
The command ran with a warning about character set which I mentioned below
我在命令行寫
mysql -u root -p
EnterPassword: 123//123 是密碼
命令行顯示如下錯誤
用戶root@localhost"的訪問被拒絕(使用密碼:**YES**)
我該如何解決這個問題?我在等你的消息.
How do I solve this? I'm waiting to hear from you.
推薦答案
您可以 重置您的根密碼.請記住,不建議使用沒有密碼的 root.
You can reset your root password. Have in mind that it is not advisable to use root without password.
這篇關于用戶“root@localhost"的訪問被拒絕(使用密碼:NO)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!