简体   繁体   English

使用XAMPP锁定PHPMyAdmin

[英]Locked out of PHPMyAdmin with XAMPP

I use CakePHP with Xampp on OSX and recently installed wordpress for the first time. 我在OSX上将CakePHP与Xampp一起使用,并且最近第一次安装了wordpress。 I changed some passwords, which I didn't realize would affect PHPMyAdmin. 我更改了一些密码,但我没有意识到这会影响PHPMyAdmin。 Upon trying to go to localhost/phpmyadmin I'm prompted with a login screen. 尝试转到localhost / phpmyadmin时,出现登录屏幕提示。 I wrote down the password and username that I changed, and still, it won't allow me in. I get the following error 我写下了更改的密码和用户名,但仍然不允许我输入。出现以下错误

Authentication required!

This server could not verify that you are authorized to access the URL "/phpmyadmin". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

I've tried doing what this post suggests but it didn't work. 我已经尝试按照这篇文章的建议进行操作,但是没有用。

This is the contents of my config.inc.php file 这是我的config.inc.php文件的内容

$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

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

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* 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'] = true;

/*
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
#$cfg['Servers'][$i]['controluser'] = 'pma';
# commented out by xampp security
#$cfg['Servers'][$i]['controlpass'] = '';
#$cfg['Servers'][$i]['controlpass'] = '';

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

I even tried re-installing XAMPP. 我什至尝试重新安装XAMPP。 I've cleared my browser history between every change I made. 在每次更改之间,我已经清除了浏览器的历史记录。

In your config.inc.php, replace 在您的config.inc.php中,替换

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

with

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

Then you'll get the "normal" phpMyAdmin login screen (with the sailboat logo). 然后,您将获得“常规” phpMyAdmin登录屏幕(带有帆船徽标)。

In your config.inc.php file notice the following(line 21 for me): 在您的config.inc.php文件中,注意以下内容(对我而言,第21行):

$cfg['Servers'][$i]['password'] = '';

if you enter password here and restart MySQL via the admin panel, you should be able to get in, it worked for me anyway. 如果您在此处输入密码并通过管理面板重新启动MySQL,则应该可以进入,无论如何它对我来说还是有用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM