I've setup wamp
server on window. Then, I use MySQL root
password by cmd. As a result, when I access phpMyAdmin site, Access denied
appeared (Default user for phpMyAdmin is root
and password is blank/empty
). So, how could I change config
variables in phpMyAdmin with new password of root.
I've searched for solution on Internet, someone advise me add some line to config.inc.php
as:
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Changed';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;
But, It seem not work. Thanks.
This question is related to
php
mysql
phpmyadmin
0) go to phpmyadmin don't select any db
1) Click "Privileges". You'll see all the users on MySQL's privilege tables.
2) Check the user "root" whose Host value is localhost, and click the "Edit Privileges" icon.
3) In the "Change password" field, click "Password" and enter a new password.
4) Retype the password to confirm. Then click "Go" to apply the settings.
I had to do 2 steps:
follow Tiep Phan
solution ... edit config.inc.php
file ...
follow Mahmoud Zalt
solution ... change password within phpmyadmin
Change It like this, It worked for me. Hope It helps. firs I did
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'changed';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$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;
Then I Changed Like this...
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$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;
you can use this command
mysql> UPDATE mysql.user SET Password=PASSWORD('Your new Password') WHERE User='root';
check the links http://www.kirupa.com/forum/showthread.php?279644-How-to-reset-password-in-WAMP-server http://www.phpmytutor.com/blogs/2012/08/27/change-mysql-root-password-in-wamp-server/
Find your config.inc.php file under the phpMyAdmin installation directory and update the line that looks like
this:
$cfg['Servers'][$i]['password'] = 'password';
... to this:
$cfg['Servers'][$i]['password'] = 'newpassword';
You can change the mysql root password by logging in to the database directly (mysql -h your_host -u root) then run
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');
Source: Stackoverflow.com