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 に問題があるとは思えないことを保証します..気づいた。これを修正するにはどうすればよいですか?

4

1 に答える 1

0

MySQL サーバーへの他の接続は機能しますか?

過去にこのエラーを 2 回見たことがあります。

  • mysql.userテーブルは完全に空で、権限がまったくありませんでした。たとえば、SUSE Studio は、ある時点でそのような仮想マシンを作成しました (まだそうかもしれませんが、私は確認していません)。
  • localhostのホストが見つかりませんmysql.user。MySQLlocalhost127.0.0.1は異なります。最初はソケット ベースの接続用で、後者は TCP ベースの接続用です。
于 2013-08-15T08:42:48.150 に答える