Setting Root Password in MySQL and PhpMyAdmin

If you are using PhpMyAdmin as part of WAMP(Windows, Apache, MySQL and PHP), then you need to take care of the root password and hence follow the steps.

If you change, only the MySQL password or PHPMyAdmin Password, then the PHPMyAdmin screen does not show the databases, files, etc (instead it will show access denied).

  1. So Both MySQL and PhpMyAdmin password should be changed and both password should be equal.
  2. Go to mysql command window (by default the MySQL has no password)
  3. Execute the command set password=password("abc123");
  4. find the config.inc.php file under phpmyadmin folder (usually in WAMP it will be under C:\wamp\apps\phpmyadmin2.11.6) and find the following line in the config.inc.php file $cfg['Servers'][$i]['password'] = ' '; // MySQL password
  5. Replace the line to $cfg['Servers'][$i]['password'] = 'abc123'; (as the password the mysql is also "abc123".
  6. now restart the server and now open http://localhost/phpmyadmin/

Comments

  1. I think the recent versions of phpMyAdmin don't require you to hardcode a password into the config file. Just put the files in the server and it will automatically try to connect to localhost. You can directly use the local server's user name and password to log in and manage the databases.

    If you want to manage a remote database (other than 'localhost'), you should enter the server info in the config file.

    Raja Sekharan

    ReplyDelete

Post a Comment

Popular Posts