Mysql – How to set password for phpMyAdmin with default install of WAMP2

MySQLpassword

I just installed it fresh, previously there would be no password at all and I'd be prompted to set one for security purposes, this time I'm just hit with an error:

"Cannot connect: invalid settings.
phpMyAdmin tried to connect to the
MySQL server, and the server rejected
the connection. You should check the
host, username and password in your
configuration and make sure that they
correspond to the information given by
the administrator of the MySQL
server."

I've changed nothing, but I did install over the top of an older version of WAMP2. That older install did not have a root password. Please don't hit me, but if there's a text fie I can update somewhere instead of getting a cmd line action wrong… I'd really like to be pointed in that direction.

I've just tried editing 'my.ini' and uncommented the password line out, so password is blank, but no luck. I don't mind setting a password and such, but right now I just want to get up and running, password or no.

Best Answer

The file that you want to take a look at is config.inc.php which should be in the root directory of your phpMyAdmin folder, for information on the settings you can put in this file take a look at http://wiki.phpmyadmin.net/pma/Quick_Install#Manually.

For a very basic config file, backup the old one, and create a new one with the following contents

<?php
// use here a value of your choice (maximum 46 characters):
$cfg['blowfish_secret'] = 'a8b7c6d';    

$i = 0;
$i++;

// 'cookie' (or 'http' , especially if mcrypt could not be loaded,
// but cookie giving more meaningful error messages in the testing phase)
// older PHP versions had some problems with "cookie" on 64 bit boxes though
$cfg['Servers'][$i]['auth_type'] = 'cookie';

// PHP 5 support for new MySQL 4.1.3+ features:
$cfg['Servers'][$i]['extension'] = 'mysqli';

// if you insist on "root" having no password, pma3 needs: 
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true; 
?>