wamp mysql无法连接到localhost

时间:2011-06-05 12:37:30

标签: mysql phpmyadmin wamp mysql-error-1130

您好 我试图跟随一个在线tut在mysql中设置密码,这现在导致我无法恢复的错误。

1)phpMyAdmin-2.11.10    这给出了下面带有消息的登录框:无法加载mcrypt。我已经启用了wamp并且还将libmcrypt.dll放在windows和windows \ system32文件夹中。但仍然得到message.if我把root放在登录框中没有通过,这导致第二个错误。

2)mysql错误

1130 - 不允许主机'localhost'连接到此MySQL服务器

我尝试了各种修复,但似乎没有任何效果。我将不胜感激任何帮助。感谢

phpMyAdmin的-2.11.10 mysql4.1.22 php4.4.7

phpmyadmin config.inc.php

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use scripts/setup.php
 *
 * All directives are explained in Documentation.html and on phpMyAdmin
 * wiki <http://wiki.phpmyadmin.net>.
 *
 * @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* 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';

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

1 个答案:

答案 0 :(得分:3)

据我所知,Wamp已经配置了phpMyAdmin。您使用过什么教程?

LE:

这是root用户还是其他帐户?如果我是你,我会备份我的数据(文件和sql),做一个全新的wamp安装(最新版本不是教程中的版本)并执行以下操作:

  • 转到开始 - &gt;运行,输入cmd
  • 使用cd命令导航安装mysql.exe的位置

使用以下命令:

mysql>
mysql>update mysql.user SET password=password("newpassword") hit enter
mysql>where user="root"; hit enter
Query OK


mysql>Flush Privileges; hit enter
Query OK
mysql>quit hit enter
mysql>bye

然后转到phpMyAdmin config.inc并编辑

$cfg['Servers'][$i]['password'] = 'newpassword';

重新启动WAMP服务器,现在应该没问题。