gpt4 book ai didi

php - 我无法访问 XAMPP phpMyAdmin;它说 : Error MySQL said: Documentation Cannot connect: invalid settings

转载 作者:行者123 更新时间:2023-11-29 03:50:04 26 4
gpt4 key购买 nike

完整错误信息:

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');

有人可以帮忙吗?谢谢。

最佳答案

我在 StackOverflow 中找到了答案。在“config.inc.php”文件中,我将“config”更改为“cookie”。这是引用自 StackOverflow 的答案:

Step 1:

Locate phpMyAdmin installation path.

Step 2:

Open phpMyAdmin>config.inc.php in your favourite text editor.

Step 3:

Search for $cfg['Servers'][$i]['auth_type'] = 'config';

Replace it with $cfg['Servers'][$i]['auth_type'] = 'cookie';

关于php - 我无法访问 XAMPP phpMyAdmin;它说 : Error MySQL said: Documentation Cannot connect: invalid settings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32237044/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com