xampp修改mysql預設密碼詳解

來源:互聯網
上載者:User

大概過程

在mysql裡設密碼開啟IE輸入網址localhostphpadmin之後,點使用者看到有root使用者,往下拉,找到修改密碼的地方,輸入密碼,進行執行操作,最後再去到在你的xampp安裝目錄下找到phpadmin檔案夾,開啟找到config.inc.php檔案之後,開啟找關於mysql配置將config改為cookie 該密碼的地方該成剛才設定的密碼就可以了。

具體方法

在瀏覽器地址上輸入http://localhost/phpmyamdin 進入到資料庫控制台,然後選擇名稱為mysql資料庫,如圖,可從中看出 user表中,root的兩個使用者的密碼為空白。

 我們可以手動編輯上圖資料庫中的root使用者的密碼即可。點快速編輯,或者編輯都可以編輯密碼,如密碼 :123456 ,則填寫 “*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9” (引號除外)

編輯後如下圖

如果想把密碼改成別的,可以直接執行西面的SQL 陳述式,把new_password改成自己的密碼即可:

1
UPDATE user SET password=PASSWORD( 'new_password' ) WHERE user= 'root' ;

另外既然mysql的root使用者密碼已經修改了,那麼phpmyadmin中的對應密碼配置也要修改,找到設定檔,如我的是

F: mppphpMyAdminconfig.inc.php

找到如下代碼

 代碼如下 複製代碼

 Authentication type and info */$cfg['Servers'][$i]['auth_type']
 = 'config';$cfg['Servers'][$i]['user']
 = 'root';$cfg['Servers'][$i]['password']
 = '';$cfg['Servers'][$i]['extension']
 = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
 = true;

修改為

 代碼如下 複製代碼


 Authentication type and info */$cfg['Servers'][$i]['auth_type']
 = 'config';$cfg['Servers'][$i]['user']
 = 'root';$cfg['Servers'][$i]['password']
 = '123456';$cfg['Servers'][$i]['extension']
 = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
 = true;

這樣就會需要重啟登入phpmyadmin了。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.