2011-06-05 126 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

相關問題