Mario88
Mario88

Reputation: 73

Can't Set PhpMyAdmin Password (XAMPP + Windows 7)

sorry if this is on the wrong board (probably should be on "security").

I have tried setting username and password from this page http://localhost/security/index.php (the second part "XAMPP DIRECTORY PROTECTION (.htaccess))", everytime it says that it was successful but when I go to http://localhost/phpmyadmin, it is always open and not asking for username and password. Also, when I open http://localhost/security/index.php "PhpMyAdmin is free accessible by network" is still showing as "unsecured".

I checked C:\XAMPP\security - xammp.users file, and the user name and password is there.

Already tried cleaning cookies and restart XAMPP.

Here is my config.inc.php:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'mypassword';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Lang'] = '';

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

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

Please help, thanks in advance.

EDIT: Additional info: I was also had the same problem when setting "MySQL admin user root", had to manually edit / put the password at the config file, couldn't do it from here http://localhost/security/index.php

Upvotes: 1

Views: 5353

Answers (1)

trejder
trejder

Reputation: 17515

You need to change your config.inc.php file, to have something like this:

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type']            = 'cookie';
$cfg['Servers'][$i]['user']                 = '';
$cfg['Servers'][$i]['password']             = '';
$cfg['Servers'][$i]['AllowNoPassword']      = false;

Then you'll have to enter password each time you login first time (for session).

Setting $cfg['Servers'][$i]['auth_type'] = 'config'; forces phpMyAdmin to use username and password stored in your configuration file ($cfg['Servers'][$i]['user'] and $cfg['Servers'][$i]['password']).

Upvotes: 3

Related Questions