mysql phpMyAdmin错误“在配置中定义的controluser连接失败,” 您所在的位置:网站首页 phpmyadmin连接其他数据库 mysql phpMyAdmin错误“在配置中定义的controluser连接失败,”

mysql phpMyAdmin错误“在配置中定义的controluser连接失败,”

2023-03-23 06:05| 来源: 网络整理| 查看: 265

我删除了mysql中的root帐户,试图加强服务器。我创建了另一个用户(让我们称之为AdminAccount),并授予%和localhost上的所有权限。从那时起,当我登录phpmyadmin时,我一直得到以下错误:mysqli::真实的连接():(HY000/1045):用户“AdminAccount '@”localhost“的访问被拒绝(使用密码:是)配置中定义的控制用户连接失败。此错误出现在每个屏幕的底部,尽管我没有看到任何功能损失-所有页面都在工作,我可以在任何数据库上工作。以下是我所做的检查:

MariaDB [(none)]> show grants for 'root'@'localhost'; +-------------------------------------------------------------------------------------------------------------+ | Grants for root@localhost | +-------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*48xxxxxxxxxxxxxx6' | | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION | +-------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.000 sec) MariaDB [(none)]> show grants for 'root'@'%'; ERROR 1141 (42000): There is no such grant defined for user 'root' on host '%' MariaDB [(none)]> show grants for 'AdminAccount'@'localhost'; +---------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for AdminAccount@localhost | +---------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO `AdminAccount`@`localhost` IDENTIFIED BY PASSWORD '*4xxxxxxxxxxxxxxxxxxxxx6' WITH GRANT OPTION | | GRANT ALL PRIVILEGES ON `phpmyadmin`.* TO `AdminAccount`@`localhost` | +---------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.000 sec) MariaDB [(none)]> show grants for 'AdminAccount'@'%'; +-------------------------------------------------------------------------------------------------------------------------------------+ | Grants for AdminAccount@% | +-------------------------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO `AdminAccount`@`%` IDENTIFIED BY PASSWORD '*48xxxxxxxxxxxxxxxxxxxxx6' WITH GRANT OPTION | +-------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.000 sec)

在此之后,我继续并添加了以下内容:

MariaDB [(none)]> GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION; MariaDB [(none)]> FLUSH PRIVILEGES;

我也试过

DROP USER ''@'localhost'; DROP USER ''@'%';

基于this link。但是我没有这个问题,它说我没有任何这样的用户。尽管进行了上述干预,但phpmyadmin中没有任何变化。我做错了什么,如何修复?我的配置:

Database server Server: Localhost via UNIX socket Server type: MariaDB Server connection: SSL is not being used Documentation Server version: 10.5.18-MariaDB-0+deb11u1 - Debian 11 Protocol version: 10 User: AccountAdmin@localhost Server charset: UTF-8 Unicode (utf8mb4) Web server Apache/2.4.54 (Debian) Database client version: libmysql - mysqlnd 8.2.1 PHP extension: mysqli curl mbstring PHP version: 8.2.1 phpMyAdmin Version information: 5.1.4deb1~bpo11+1

**编辑:**我发现了一个潜在的问题。我被告知要查找以下内容:

$cfg['Servers'][$i]['user'] = 'your_username'; $cfg['Servers'][$i]['password'] = 'your_password';

在phpmyadmin的配置文件中。然而,在/etc/phpmyadmin/config. inc. php中,这些行不存在。相反,我发现了以下内容:

$cfg['Servers'][$i]['controluser'] = $dbuser; $cfg['Servers'][$i]['controlpass'] = $dbpass;

但是什么是$dbuser和$dbpass?我在那个文件或任何其他文件中都没有找到这些变量。我使用grep搜索/etc/phpmyadmin下的所有目录和子目录



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有