Php #1130-主机';本地主机';是否不允许连接到此MySQL服务器消息?

Php #1130-主机';本地主机';是否不允许连接到此MySQL服务器消息?,php,phpmyadmin,Php,Phpmyadmin,因此,我最近制作了一个注册PHP,我正要制作一个数据库,但突然出现了以下消息: Error MySQL said: Documentation # 1130 - Host 'localhost' is not allowed to connect to this MySQL server 然后它告诉我去我的config.inc.php,我到了那里,这里是其中的信息: <?php /* * This is needed for cookie based authentication t

因此,我最近制作了一个注册PHP,我正要制作一个数据库,但突然出现了以下消息:

Error

MySQL said: Documentation
# 1130 - Host 'localhost' is not allowed to connect to this MySQL server
然后它告诉我去我的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'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['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'] = '127.0.0.1';
$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';

/*
 * End of servers configuration
 */

?>


现在,正如你所看到的。我连接的是127.0.0.1,不是localhost/phpmyadmin,而是127.0.0.1/phpmyadmin,我向您保证,我怀疑config.inc有问题,但是自从我安装wordpress org后,这种情况就发生了,但今天我注意到了。如何修复此问题?

到MySQL服务器的其他连接是否正常

我过去曾在两个场合看到过这种错误:

  • mysql.user
    表完全为空,没有提供任何特权。例如,SUSE Studio在某个时候生产了这样的虚拟机(可能仍然是这样,我没有检查)
  • 您在
    mysql.user
    中缺少
    localhost
    主机。对于MySQL,
    localhost
    127.0.0.1
    是不同的-第一个用于基于套接字的连接,而后者用于基于TCP的连接

使用
localhost
而不是IP<代码>使用GRANT选项将**上的所有内容授予“root”@“localhost”,由“root\u PASSWORD\u GOES\u HERE”标识--这将解决问题。