phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连接--解决方法

来源:互联网 发布:任亮java视频 编辑:程序博客网 时间:2024/04/30 04:15

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

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

 

解决方法:

1)修改phpmyadmin 下的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';


解决方法:
http://www.ithao123.cn/content-702800.html
  1 //$cfg['Servers'][$i]['auth_type'] = 'config';
  2 $cfg['Servers'][$i]['auth_type']  =  'cookie';
  3 $cfg['Servers'][$i]['user']  =  'root';
  4 $cfg['Servers'][$i]['password']  =  '';
  5 $cfg['Servers'][$i]['extension']  =  'mysql';
  6 $cfg['Servers'][$i]['AllowNoPassword']  =  true;
  7 $cfg['Lang']  =  '';
  
行1,注释掉这行
行2,添加这行


0 0
原创粉丝点击