gpt4 book ai didi

mysql - 您的配置中定义的 controluser 连接失败。 #1045 无法登录 MySQL 服务器

转载 作者:可可西里 更新时间:2023-11-01 11:18:15 24 4
gpt4 key购买 nike

我在我的窗口中安装了 xampp。以前,我可以使用我的用户名和密码轻松登录到我的 phpmyadmin。很长一段时间后,我无法使用以下消息登录 phpmyadmin:

#1045 Cannot log in to the MySQL server 
Connection for controluser as defined in your configuration failed.

我相信我的密码是真的(来自 config.inc.php)

这是config.inc.php

<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['password'] ='1234';
$cfg['Servers'][$i]['extension'] = 'mysql';
$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';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';

/*
* End of servers configuration
*/

?>

最佳答案

根据config.inc.php你已经发布了,你的 root 用户密码是 1234(正如我在 $cfg['Servers'][$i]['password'] ='1234'; 行中看到的),但是稍后在文件中定义 controluser 时,你使用了一个空白密码。

我建议设置一个权限低于 root 的实际控制用户,但快速修复是编辑并进行此更改:$cfg['Servers'][$i]['controlpass'] = '1234';

要创建 controluser 帐户,请使用类似于以下的 SQL 命令:

GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';

<pma_db> 替换为您的 phpMyAdmin 配置存储数据库的名称(可能是“phpmyadmin”)和 pmapass 的自定义密码.

关于mysql - 您的配置中定义的 controluser 连接失败。 #1045 无法登录 MySQL 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27381618/

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