2012-09-01 53 views
52

PHPMyAdmin向我發送一條消息,指出用戶(root)沒有密碼。爲PHPMyAdmin創建root密碼

那麼,我該如何創建一個?

+0

root用戶的MySQL?或服務器根? phpmyadmin不需要服務器根目錄。爲什麼呢?你需要查看mysql用戶帳戶,並將其設置爲phpmyadmin – DarthVader

回答

25

好了,我相信我已經解決了密碼配置「問題」 - WampServer 2.2 - Windows 7的

,我做了三個步驟:

  1. 在MySQL控制檯設置新密碼。要做到這一點:mysqladmin -u root password 'your_password'

  2. phpMyAdmin點擊用戶並設置相同的密碼給用戶root

  3. 最後,在config.inc.php中設置新密碼。不要更改此文件中的其他內容。

這對我有效。祝你好運!

丹尼爾

+0

修改config.inc.php文件(第3步)後,可能需要重新啓動瀏覽器。 –

0

我相信你正在尋找的命令是passwd

5

phpMyAdmin是告訴你,你的MySQL服務缺失的根密碼。您可以通過訪問MySQL命令行界面來更改它。 mysqladmin -u root password newpass

http://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords

+0

,如果他從未創建過,則比重置更容易。 – DarthVader

+1

我顯示的命令是設置密碼,而不是重置。 – ThoKra

+0

非常感謝!但是,我怎樣才能在MySQL服務器中插入該命令?我的意思是,我已經安裝了phpMyAdmin和Workbench。對不起,如果這太「新手問題」...... –

88

打開phpMyAdmin的,並選擇SQL選項卡。然後鍵入以下命令:

SET PASSWORD FOR [email protected] = PASSWORD('your_root_password'); 

編輯:

也改變這一行config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

爲了phpMyAdmin的提示你的MySQL用戶名和密碼。

+1

此代碼只是拒絕我訪問phpmyadmin。現在無法訪問它。 –

+1

@DanielMontenegro見我編輯的答案。 – flowfree

+1

我不得不改變這一行 $ cfg ['Servers'] [$ i] ['password'] ='your_root_password'; – Malintha

5
  • 轉到http://localhost/security/index.php
  • 選擇語言,它重定向到http://localhost/security/xamppsecurity.php
  • 你會發現一個選項來改變這裏的密碼
2

我只需要改變一行的文件config.inc.php位於C:\wamp\apps\phpmyadmin4.1.14

這裏寫正確的密碼...

$cfg['Servers'][$i]['password'] = 'Put_Password_Here'; 
2

這裏簡單的步驟,你可以輕鬆地設置密碼PHPMYADMIN。

  1. 轉到「C:\ XAMPP的\ phpMyAdmin的」,找到「Config.inc。php「文件
  2. 在文本編輯器(如Notepad ++)中打開」Config.inc.php「文件。
  3. 查找行$ cfg ['Servers'] [$ a] ['auth_type'] ='config'; 「config.inc.php」文件中的
  4. 更改單詞$ cfg ['Servers'] [$ a] ['auth_type'] ='config';$ cfg ['Servers'] [$ a] ['auth_type'] ='cookie';在「config.inc.php」文件中輸入並保存更改。
  5. 現在打開瀏覽器並輸入「localhost/phpmyadmin」。輸入用戶名是「root」。密碼爲空意味着空的。你不要輸入任何東西留空,然後按GO按鈕。
  6. 現在你可以看到「更改密碼」鏈接。請點擊該鏈接。
  7. 設置您的phpMyAdmin密碼並重新鍵入,然後按GO按鈕。 您也可以參考說明指南click here來參閱該步驟指南。
6

要在UI簡單的方法創建在phpMyAdmin根密碼,可以按照以下簡單步驟:用root賬戶(無密碼)

  • 訪問phpMyAdmin的 - >用戶帳戶。

enter image description here

點擊根>編輯權限

enter image description here

然後在更改密碼點擊

enter image description here

輸入你想要的密碼 - >去

enter image description here

註銷,並用新的密碼

0

我剛剛遇到的mysql用戶密碼的問題再次登錄 - 錯誤1045:訪問被拒絕的用戶:「根@本地」(使用密碼:NO) - 當我嘗試在我的操作系統上進行發佈升級時。所以我分兩步糾正它。

首先,我沒有對phpMyAdmin的訪問,所以我也跟着由ThoKra mensioned教程「恢復MySQL root密碼」的步驟: https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords

其次,我知道的一個用戶密碼,我根據SonDang通過phpmyadmin自己對其他用戶進行了一些密碼更改。

1
  1. 進入phpmyadmin的

  2. 打開用戶帳戶部分:

    open user account section

  3. 使用編輯權限

  4. 更改用戶名和密碼

    change password and user name

  5. 數據庫添加權限