2011-06-05 67 views
0

你好 我试图按照在线tut在mysql中设置密码,这现在导致了错误,我无法从中恢复。wamp mysql无法连接到本地主机

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

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'] = ''; 

?> 
+0

这听起来像你在MySQL中登录的用户名(通过phpmyadmin)它的“主机”字段设置为“本地主机”或“%”(任何主机)以外的东西。 – rightstuff 2011-06-10 16:36:03

回答

3

据我所知,WAMP自带phpMyAdmin的已配置。你使用过什么教程?

LE:

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

  • 开始 - >运行,输入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服务器,现在应该可以。

+0

嗨。 http://guides.jlbn.net/setpw/setpw5.html – bollo 2011-06-05 13:05:52

+0

您是否已经仔细检查过mcrypt扩展在php中是否启用?如果是,请尝试并重新启动整个Wamp设置。 – BebliucGeorge 2011-06-05 13:12:22

+0

当你没有密码时不会出错,你必须在config.inc.php文件中添加$ cfg ['Servers'] [$ i] ['AllowNoPassword'] = true; – BebliucGeorge 2011-06-05 13:14:16