xampp中修改mysql默認空密碼(root密碼)的方法分享

首先說明下mysql用戶的相關信息是保存在mysql數據庫的user表中的,並且該表的密碼字段(Password)是通過PASSWORD方法加密存儲的。

明白了以上提示,那麼修改密碼就簡單了,直接運行如下SQL語句即可(這裏將密碼修改爲root):

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

201442585219781.png?201432585333

經過以上操作,密碼就修改了。

如果你希望以後直接輸入localhost/phpMyadmin還能直接進入phpMyadmin的管理界面而不用輸入用戶名和密碼的話,還需要進行如下操作:

找到phpMyadmin的配置文件,即phpMyAdmin目錄下的config.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'] = 'root';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;


轉載自: http://www.jb51.net/article/49340.htm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章