wamp通过phpMyAdmin修改登录密码

初始安装wamp后,默认mysql是没有密码的,这个时候如果想要修改密码,可以按照以下步骤进行:

第一、打开phpMyAdmin,看到界面如图所示:

第二、通过导航找到“用户”,再找到“编辑权限”进行修改,如图:

第三、进入“编辑权限”界面,找到“修改密码”,进行修改密码,然后点击“执行”。

第四、找到phpmyadmin中的config.inc.php文件(路径C:WAMP2appsphpmyadmin4.1.14,这是将wamp安装的C盘的路径)

第五、打开config.inc.php,找到$cfg['Servers'][$i]['password']一行,进行修改,代码如下:

/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';//在这里将密码修改为在phpMyAdmin中设置的密码
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
原文地址:https://www.cnblogs.com/benbenzhu/p/5554842.html