quot;Connection for controluser as defined in your configuration failedquot; with phpMyAdmin in XAMPP(“您的配置中定义的 controluser 连接失败在 XAMPP 中使用 phpMyAdmin)
问题描述
我刚刚在我的 Windows XP 机器上安装了 XAMPP,我收到一条错误消息:
I have just installed XAMPP on my Windows XP machine, and I get an error saying:
您的配置中定义的 controluser 连接失败.
Connection for controluser as defined in your configuration failed.
在我安装 XAMPP 之前,我安装了一个 MySQL 数据库并且它有一个密码.我更改并将密码放在 config.inc.php for MySQL 中,出现此错误:
Before I installed XAMPP, I had a MySQL database installed and it had a password. I changed and put the password in config.inc.php for MySQL, and I got this error:
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
当我尝试访问 index.php 时,XAMPP 安装似乎有问题.我该怎么做才能解决这个问题?
When I try to access index.php, it seems like something is wrong with the XAMPP installation. What can I do to fix this problem?
推荐答案
- 在浏览器中打开 phpMyAdmin 并以 root 身份登录.
- 创建一个名为
phpmyadmin
的数据库 - 创建一个名为
pma
的用户并将host"设置为您的网络服务器的主机名或 IP 地址(如果网络服务器和 MySQL 在同一个框中,请使用localhost
),记下密码,并授予新用户对phpmyadmin
数据库的完全控制权.建议此用户不能访问此数据库以外的任何内容. - 转到 phpMyAdmin 安装目录,您应该在其中找到一个名为
sql
的子目录. - 在
sql
中,您将找到一个名为create_tables.sql
的文件.在文本编辑器中打开它. - 在 phpMyAdmin 中,选择
phpmyadmin
数据库并单击SQL"选项卡. - 将
create_tables.sql
中的整个文本复制/粘贴到文本框中,然后运行查询. 打开 phpMyAdmin 安装目录中的
config.inc.php
文件,并添加以下几行(或更改现有设置,如果它们已经存在):
- Open phpMyAdmin in a browser and log in as root.
- Create a database called
phpmyadmin
- Create a user called
pma
and set the "host" to the hostname or IP address of your web server (if the web server and MySQL are on the same box uselocalhost
), make a note of the password, and grant the new user full control over thephpmyadmin
database. It is recommended that this user does not have access to anything other than this database. - Go to the phpMyAdmin installation directory, where you should find a sub-directory called
sql
. - In
sql
you will find a file calledcreate_tables.sql
. Open it in a text editor. - In phpMyAdmin, select the
phpmyadmin
database and click on the "SQL" tab. - Copy/paste the entire text from
create_tables.sql
into the text box, and run the query. Open the
config.inc.php
file in the phpMyAdmin install directory, and add the following lines (or change the existing settings if they are already there):
$cfg['Servers'][1]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][1]['controluser'] = 'pma';
$cfg['Servers'][1]['controlpass'] = '<your password>';
// Note: The list below may grow as PMA evolves and more control tables are added
// Use your common sense! Don't just blindly copypasta, look at what it means!
$cfg['Servers'][1]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][1]['relation'] = 'pma_relation';
$cfg['Servers'][1]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][1]['table_info'] = 'pma_table_info';
$cfg['Servers'][1]['column_info'] = 'pma_column_info';
$cfg['Servers'][1]['history'] = 'pma_history';
$cfg['Servers'][1]['recent'] = 'pma_recent';
$cfg['Servers'][1]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][1]['tracking'] = 'pma_tracking';
$cfg['Servers'][1]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][1]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][1]['designer_coords'] = 'pma_designer_coords';
保存并关闭文件.
Save and close the file.
重要 - PMA 在登录时加载配置,对其进行评估并将其存储到会话数据中,因此在您执行此操作之前消息不会消失:
IMPORTANT - PMA loads the config on login, evaluates it and stores it into the session data so the message will not disappear until you do this:
- 退出 phpMyAdmin 并重新登录
问题解决了.
这篇关于“您的配置中定义的 controluser 连接失败"在 XAMPP 中使用 phpMyAdmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“您的配置中定义的 controluser 连接失败"在 XAMPP 中使用 phpMyAdmin
基础教程推荐
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01