【发布时间】:2015-11-21 02:35:32
【问题描述】:
完整的错误信息:
Error
MySQL said: Documentation
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
到目前为止,我一直在使用网络托管站点服务器;这可能弄乱了我的 xampp 连接。我的phpMyAdmin“config.in.php”文件设置如下:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
我可以在“localhost:8080”运行我使用 xampp 创建的 php 代码,但我无法访问 mysql。我的数据库连接配置如下:
// Databse Connection Constants
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASS',','');
define('DB_NAME','gallery_db');
有人可以帮忙吗?谢谢。
【问题讨论】:
标签: php mysql phpmyadmin xampp database-connection