0

所以我最近做了一个注册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 之后就发生了这种情况,但是今天我已经注意到了。我该如何解决?

4

1 回答 1

0

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

我在过去两次看到过这个错误:

  • 桌子完全是空的mysql.user,根本没有任何特权。例如 SUSE Studio 在某些时候生产过这样的虚拟机(也许现在仍然如此,我没有检查)。
  • 您在 中缺少localhost主机mysql.user。对于 MySQLlocalhost并且127.0.0.1是不同的 - 第一个用于基于套接字的连接,而后者用于基于 TCP 的连接。
于 2013-08-15T08:42:48.150 回答