每当我尝试访问我的localhost / phpmyadmin时,它都会给我这个错误---> 错误 MySQL说:
配置中定义的controluser连接失败。
我真的需要你的帮助,我很无能为力。下面是我的config.inc.php文件 非常感谢你的帮助!
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp';
/*
*Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '**********';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
/*
* End of servers configuration
*/
?>
答案 0 :(得分:1)
来自Mysql documentation:
错误(2002)无法连接到...通常表示系统上没有运行MySQL服务器,或者在尝试连接服务器时使用的是不正确的Unix套接字文件名或TCP / IP端口号。您还应检查您使用的TCP / IP端口是否未被防火墙或端口阻止服务阻止。
答案 1 :(得分:0)
在Linux系统上,您应该将以下内容添加到config.inc.php
$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
or
$cfg['Servers'][$i]['connect_type'] = 'tcp';
在Windows系统上,
$cfg['Servers'][$i]['socket'] = "c:/tmp/mysql.sock"
同样的更改也必须反映在xampp \ mysql \ bin \ my.ini文件中。
答案 2 :(得分:0)
当我试图打开phpmyadmin时我也得到了相同的错误,我从我的系统中删除了mecafee然后我重新启动了系统,从那时起它工作正常,可能是mecafee(anit病毒)是问题...希望它有效为你...