2012-11-11 195 views
0

我得到一个错误,当我尝试登录到myphpadmin ...phpMyAdmin的本地主机的错误(XAMPP)

#1045 Cannot log in to the MySQL server 
Connection for controluser as defined in your configuration failed. 

是有什么错我的配置文件?

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

/* 
* First server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'localhost'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysql if your server does not have mysqli */ 
$cfg['Servers'][$i]['extension'] = 'mysqli'; 
$cfg['Servers'][$i]['AllowNoPassword'] = false; 

/* 
* phpMyAdmin configuration storage settings. 
*/ 

/* User used to manipulate with storage */ 
$cfg['Servers'][$i]['controlhost'] = ''; 
$cfg['Servers'][$i]['controluser'] = '<username here>'; 
$cfg['Servers'][$i]['controlpass'] = '<password here>'; 

/* Storage database and tables */ 
// $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]['table_uiprefs'] = 'pma_table_uiprefs'; 
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; 
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; 
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; 
// $cfg['Servers'][$i]['recent'] = 'pma_recent'; 
/* Contrib/Swekey authentication */ 
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; 

/* 
* End of servers configuration 
*/ 

我不由得注意到,很多这是犯了....应该是?

我真的不知道我在做什么...任何帮助将是惊人的!

回答

1
$cfg['Servers'][$i]['controluser'] = '<username here>'; 
$cfg['Servers'][$i]['controlpass'] = '<password here>'; 

这两行起码需要进行配置,如果你只是做了一个基本安装要么他们都是空白或用户名是root,密码为空。如果您分配了用户名和密码,他们将进入这些字段,并且由于您允许没有密码设置为false,所以您需要使用用户名和密码设置数据库或将该值设置为true。在本地测试时没有密码是正确的,但不是当您将其上传到您的实时服务器时。

-1

删除所有相关的cookies后关闭它,然后如果不工作检查你的php ini配置文件,看看用户是否已被改变。

+0

删除我的浏览器上的所有cookie? – user1269625

+0

这是不会做任何事情的,因为根据我的回答,原因是你的错误用户名和密码传递给数据库。这应该是由它返回的错误显而易见的。 –

0

如果有帮助,这是我的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; 

/* 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'; 

/* 
* End of servers configuration 
*/ 

?> 

如果我进入phpMyAdmin的,然后单击权限选项卡我也有以下用户:

User Host Password Global privileges Grant 
Any  %   --  USAGE    No 
Any  localhost No  USAGE    No 
pma  localhost No  USAGE    No 
root 127.0.0.1 No  ALL PRIVILEGES  Yes 
root localhost No  ALL PRIVILEGES  Yes 
+0

它帮助,但现在我得到这个错误,当我登录到phpmyadmin'phpMyAdmin配置存储没有完全配置,一些扩展功能已被停用.'和我无法创建一个数据库(无特权)它说 – user1269625

+0

我添加到我的文章包括他们在phpMyAdmin中的用户和权限。我希望这有帮助。 – Boundless