我在尝试将PhpMyAdmin重新连接到MySQL DB时遇到常见问题。一开始一切正常,然后说2或3天工作正常,由于某种未知原因,我得到了错误:
“ mysqli_real_connect():(HY000 / 2002):phpMyAdmin尝试连接到MySQL服务器,并且服务器拒绝了连接。您应检查配置中的主机,用户名和密码,并确保它们与MySQL服务器管理员提供的信息”。
我在config.ini php文件中使用了相同的基本连接参数,因为创建了主机的数据库名称和USER:'localhost'/ PORT:'3306'/ USER:'root'/ PASS :'root'
我的系统是Microsoft Windows 10 Pro版本10.0.17763 适用于Windows 4.1.0.23876的MAMP PHP最新版本7.2.10 MySQL版本5.7.24
我尝试更改MAMP的bin目录中PhpMyAdmin文件夹中的config.ini.php文件中的连接参数,尝试更改值,例如将'localhost'设置为'127.0.0.1'或'config'设置为'cookie',当然检查并确保主机,端口,用户和密码与MAMP上的phpinfo相同,但似乎无济于事。
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$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;
$cfg['Servers'][$i]['port'] = '3306'; // MySQL port
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'root'; // MySQL password
我希望MySQL服务器能够通过修复config.ini文件或我肯定不知道的其他文件中的连接服务器参数,以某种方式重新连接phpMyAdmin,而不必重新安装所有内容,因此会丢失到目前为止所有的wordpress网站进度