-1

我试图让 phpmyadmin 启动,当我尝试将它与 xampp 一起使用时,访问被拒绝。给出以下错误代码:

#1045 - Access denied for user 'root'@'localhost' (using password: NO) 

phpMyAdmin 尝试连接 MySQL 服务器,但服务器拒绝连接。您应该检查配置中的主机、用户名和密码,并确保它们与 MySQL 服务器管理员提供的信息相对应。

我已阅读相关答案并尝试更改线路

$cfg['Servers'][$i]['auth_type'] = 'config' to $cfg['Servers'][$i]['auth_type'] = 'cookie',但这并没有提供解决方案。有什么想法吗?我正在使用 Windows 7。

这是当前文件:

* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'HTTP';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$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';

/* * 服务器配置结束 */

4

1 回答 1

2

检查此链接它可能会帮助您解决问题。

1. Open config.inc.php file in the phpmyadmin directory

2. Find line 21: $cfg['Servers'][$i]['password'] = ''

3. Change it to: $cfg['Servers'][$i]['password'] = 'your_password';

4. Restart XAMPP 


The setting you are looking for is "$cfg['Servers'][$i]['auth_type']" - set this to 'HTTP', and you will be able to input a username and password.
于 2012-10-03T18:30:27.923 回答