phpmyadmin localhost错误(xampp)

I am getting an error when I try to login to myphpadmin...

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

is there something wrong with my config file?

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

I couldnt help but notice that alot of this is committed out....should it be?

I really dont know what I am doing...any help would be amazing!!!!!

3个回答

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

Those two lines at the very least need to be configured, if you just did a base install either they're both blank or the username is root and the password is blank. If you assigned a user name and password they go in those fields, and since your allow no password is set to false then you need to set your DB up with a username and password or set that value to true. Having no password when testing locally is fine, NOT when you upload it to your live server though.

If it helps, this is what my config.inc.php file looks like:

<?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
 */

?>

If I go into phpMyAdmin and click the privileges tab I also have the following users:

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
dqf35839
dqf35839 我添加到我的帖子中以包含他们在phpMyAdmin中拥有的用户和权限。 我希望这有帮助。
接近 8 年之前 回复
dtxob80644
dtxob80644 它有所帮助,但现在我在登录phpmyadmin时出现此错误phpMyAdmin配置存储未完全配置,某些扩展功能已被停用。 而且我无法创建一个数据库(No Privileges)
接近 8 年之前 回复



将所有相关的cookie关闭后删除所有相关的cookie,然后如果不工作检查你的php ini配置文件,看看用户是否有 被改变了。</ p>
</ div>

展开原文

原文

Delete all the related cookies after closing it all down,, then if that dont work check your php ini config file to see if user has been altered.

douqipi9704
douqipi9704 这不会做任何事情,根据我的回答,原因是你将错误的用户名和密码传递给数据库。 这应该是由它返回的错误显而易见的。
接近 8 年之前 回复
dounang1974
dounang1974 删除浏览器上的所有cookie?
接近 8 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐