在使用WampServer工具时,默认root账户为空密码,可修改mysql密码。
默认为root空密码时,可直接登陆phpMyAdmin,然后进入mysql数据库,点击进入sql输入界面。输入以下命令:
update user set password=password('123456') where User='root'
其中123456为你希望修改的密码。(该步骤为mysql配置root账户密码,配置完mysql数据库密码后,可用新密码直接从MYSQL console工具登录mysql系统。)
执行后,接着还要进入phpmyadmin目下下的libraries目录(新版是该目录,也可能在根目录C:\wamp\apps \phpmyadmin3.5.1),修改config.default.php文件。找到$cfg['Servers'][$i]['password'] = ' ',
修改为$cfg['Servers'][$i]['password'] = '123456'; 123456就是您想要的密码。重启mysql后新密码在phpmyadmin中生效。
检查 C:\wamp\apps \phpmyadmin3.5.1下的config.inc.php修改
$cfg['Servers'][$i]['AllowNoPassword'] = false; //是否允许空密码
实现phpmyadmin自动登陆
打开config.inc.php 找到 $cfg['Servers'][$i]['auth_type']
将 $cfg['Servers'][$i]['auth_type'] = 'cookie';
中的 cookie 改成 http 或者 config
即
$cfg['Servers'][$i]['auth_type'] = 'http';
或者
$cfg['Servers'][$i]['auth_type'] = 'config';
然后找到$cfg['Servers'][$i]['user']等,修改如下:
$cfg['Servers'][$i]['user'] = 'root'; // 设置的mysql用户名
$cfg['Servers'][$i]['password'] = '123456′; // 设置的mysql密码
取消phpmyadmin自动登陆
只需把
$cfg['Servers'][$i]['auth_type'] = 'http'; //或config
改成
$cfg['Servers'][$i]['auth_type'] = 'cookie';
保存。
其他更复杂的情况,有待探究。