这几天开始学习PHP,用的环境是XAMPP,开始安装好所有的访问都没有问题,自己改了下MySql root的密码,然后PhpMyAdmin就没办法访问Mysql了,显示访问被拒绝,用户名或者密码错误,网上搜了下,好多同样的问题,修改phpMyAdmin目录下的config.inc.php的密码,
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
改完发现还是有问题,
后来才查到,原来需要增加下面这几行
$cfg['SQLValidator']['use'] = FALSE; // Make the SQL Validator available
$cfg['SQLValidator']['username'] = 'root'; // If you have a custom username, specify it here (defaults to anonymous)
$cfg['SQLValidator']['password'] = 'root'; // Password for username
2个是不同的配置。
特此记录以便有其他人遇到同样问题。