Thinkphp错误-phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连

phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连接。您应该检查配置文件中的主机、用户名和密码,并确认这些信息与 MySQL 服务器管理员所给出的信息一致。

原因有可能是因为修改了mysql数据库的密码导致。

解决方法:

1)修改wampappsphpmyadmin4.1.14下的config.inc.php中的 $cfg['Servers'][$i]['password'] = '';选项

2)修改$cfg['Servers'][$i]['auth_type'] = 'http'; //修改为http
当然,到了这里也许还是会出错,因为这是IE缓存所致,选择IE Internet选项->常规-》清除浏览记录,清除缓存后解决问题

以下是config.inc.php中有关数据库配置的配置信息:

在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';

注明:如果在安装wamp之前本机有安装mysql数据库,则在password处填写本机mysql数据库的密码

原文地址:https://www.cnblogs.com/dekevin/p/4916985.html