2014-01-23 34 views
0

我忘記了root密碼,所以後面跟着幾個不同的方法重置,最終奏效。MySQL只適用於:skip-grant-tables

現在我無法在PHPmyAdmin上創建新數據庫,顯示消息「沒有權限」。

所以我嘗試添加的所有權限ROOT再次使用:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 

但後來我得到的錯誤:

#1290 - The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 

所以我從刪除「跳過贈款表」 my.ini,然後我的基於MySQL的網站停止工作。

我已經正式將它淹沒了嗎?

+3

您是否嘗試過運行'FLUSH PRIVILEGES'或重新啓動MySQL服務器。 – Cyclonecode

+0

@KristerAndersson我沒有運行FLUSH PRIVILEGES,但我已重新啓動。 – MRC

+0

@KristerAndersson沖洗工作。謝謝,添加爲答案,我會選擇它。 – MRC

回答

2

確保您刷新特權:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 
FLUSH PRIVILEGES; 

documentation

Reloads the privileges from the grant tables in the mysql database.

The server caches information in memory as a result of GRANT and CREATE USER statements. This memory is not released by the corresponding REVOKE and DROP USER statements, so for a server that executes many instances of the statements that cause caching, there will be an increase in memory use. This cached memory can be freed with FLUSH PRIVILEGES.