输入用户名和密码后点击“执行”,报错: “#2002 无法登录 MySQL 服务器”。
解决:
将 “phpMyAdmin/libraries”文件夹下的config.default.php文件中的
$cfg['Servers'][$i]['host'] = 'localhost';
修改为$cfg['Servers'][$i]['host'] = '127.0.0.1';
修改根目录中的config.inc.sample.php为config.inc.php,页面无法正常打开。
解决:
添加如下内容至配置文件
/*phpMyAdmin访问地址为http://localhost/~yaoyao/phpMyAdmin*/
$cfg['Servers'][$i]['PmaAbsoluteUri']="http://localhost/~yaoyao/phpMyAdmin";基础配置:
/*phpMyAdmin访问地址为http://localhost/~yaoyao/phpMyAdmin*/
$cfg['Servers'][$i]['PmaAbsoluteUri']="http://localhost/~yaoyao/phpMyAdmin";
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* 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]['PmaAbsoluteUri']="http://localhost/~yaoyao/phpMyAdmin";
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* 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'] = false;
若不设置其他内容,则为默认配置,如端口等。