2014-01-22 42 views
7

我看到這個問題已經被問了很多次,但我不覺得我的問題的解決方案。在config.inc.phpXAMPP phpMyAdmin的錯誤1045:「訪問被拒絕的用戶‘根’@‘localhost’的

嘗試所有可能的組合
$cfg['Servers'][$i]['auth_type'] = 'http'; 
$cfg['Servers'][$i]['user'] = 'root'; 
$cfg['Servers'][$i]['password'] = 'root'; 
$cfg['Servers'][$i]['extension'] = 'mysql'; 
$cfg['Servers'][$i]['AllowNoPassword'] = true; 
$cfg['Lang'] = ''; 

/* Bind to the localhost ipv4 address and tcp */ 
$cfg['Servers'][$i]['host'] = 'localhost'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 

/* User for advanced features */ 
$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = 'pmapass'; 

我安裝XAMPP。在phpMyAdmin我修改的[email protected]密碼。我能夠使用新密碼登錄到phpMyAdmin。

但是,當我添加一個新用戶的Drupal按照Drupal的安裝步驟,我得到此錯誤:

Error 1045, "Access denied for user 'root'@'localhost' (Password: YES) 

但仍然drupal用戶被創建,但在MySQL中的drupal數據庫不會被創建。

當我嘗試創建分開的drupal數據庫時,我能夠做到這一點。

除此之外,我試過MySQL.exe -u root -p。它在那裏工作得很好,所以我不確定。

+0

儘量保持密碼爲空 – PravinS

回答

1

嘗試改變

$cfg['Servers'][$i]['host'] = 'localhost';

$cfg['Servers'][$i]['host'] = '127.0.0.1';

+0

這已經是 '127.0.0.1',我改成了 'localhost' 的。兩者都不起作用。 – Kripa

0
$cfg['Servers'][$i]['auth_type'] = 'config'; 

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

重新啓動,你會被要求輸入密碼來

phpMyAdmin的頁面進行下一次存取次
0

1045 - 拒絕訪問用戶「根」 @「localhost」的(使用密碼是)

我已經嘗試了一切,但是這是最好的解決方案

解決方案: 打開XAMPP控制面板 config.inc .php

$ cfg ['Servers'] [$ i] ['auth_type'] ='config'; 至

$ cfg ['Servers'] [$ i] ['auth_type'] ='cookie';

工作很好!

1

在config.inc.php中

編輯

$cfg['Servers'][$i]['auth_type'] = 'whatever_it_is'; 

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

然後重啓。

還有一些魔法會發生!

0

添加如下所示:

/opt/lampp/phpmyadmin/config.inc.php

代碼:

/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'config'; 
$cfg['Servers'][$i]['user'] = 'admin'; 
$cfg['Servers'][$i]['password'] = ''; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = '127.0.0.1'; 
$cfg['Servers'][$i]['compress'] = false; 
$cfg['Servers'][$i]['AllowNoPassword'] = true; 
相關問題