#1130 - 主机'localhost'不允许连接到这个MySQL服务器奇怪的消息?

时间:2013-08-14 14:22:49

标签: 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 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组织以来,这已经发生了,但今天我已经注意到了我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

与MySQL服务器的其他连接是否有效?

我曾两次看到过这个错误:

  • mysql.user表完全为空,完全没有任何权限。例如,SUSE Studio在某些时候生产了这样的虚拟机(也许情况仍然如此,我没有检查过。)
  • 您在localhost中遗失了mysql.user个主机。对于MySQL localhost127.0.0.1是不同的 - 第一个用于基于套接字的连接,而后者用于基于TCP的连接。