Reputation: 17384
I changed the root password to test and now I cannot login in phpMyAdmin page in XAMPP. I looked for help here and here which basically says changed config.inc.php file in XAMPP\PHPMYADMIN folder.
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'test'; <---- changed this
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'test'; <--- I changed this too (Edit: Not needed)
This code below works which uses the above password
if($_SERVER['REMOTE_ADDR']=="127.0.0.1")
{
define("DATABASE_SERVER", "localhost");
define("DATABASE_USERNAME", "root");
define("DATABASE_PASSWORD", "test");
define("DATABASE_NAME", "TIGERWOODS");
}
This happend to me bofore on Mac and I could not resolve it. Now it happened again on WinXP. I am using Xampp 1.7.4.
Upvotes: 85
Views: 392789
Reputation: 13
Here is an answer from a video on Youtube name: "MySQL said Cannot connect invalid settings error | XAMPP phymyadmin" from channel MicroNG and it work with my case
I configured on Xampp Control to make my MySQl using port 3308 and Apache using port 443 and 8088 .It run but when click Admin to open http://localhost:8088/phpmyadmin/
it show the error in this thread
Solution here:
1.Go to C:\xampp\phpMyAdmin\config.inc.php
2.Below the line: $cfg['Servers'][$i]['AllowNoPassword'] = true;
Add $cfg['Servers'][$i]['port'] = 3308;
3.Stop xampp MySQL and start again
Upvotes: 0
Reputation: 39
- It is not working because If 3306 port already used (may be another mysql is available)
- Open C:\xampp\phpMyAdmin ==> config.inc
|--------> $cfg['Servers'][$i]['AllowNoPassword'] = true; add below line after this line
|--------> $cfg['Servers'][$i]['port'] = 3308;
- Open Xampp Panel ---> Near Start/Stop ---> Admin --> Config
|------ Click on This
|---- It will show my.ini file
|-----Here change the Port 3306 to 3308
Upvotes: 1
Reputation: 571
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
if u change port address
Upvotes: 47
Reputation: 1428
Solution for Windows:
you can also config your xampp app to always run as admin
Upvotes: -1
Reputation: 454
**Step1**: Go to xampp/phpMyAdmin/config.inc.php
**Step2**: Search this: $cfg['Servers'][$i]['host'] = '127.0.0.1';
**Step3**: Replace with $cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
Here 3307 will be change with your mysql port number, in my case it is 3307. Most of the times it will be 3306.
You can check your mysql port number from here : xampp/mysql/bin/my.ini
Upvotes: 9
Reputation: 699
In xampp\phpMyAdmin\config.inc.php : changing:
'config';$cfg['Servers'][$i]['user'] = 'root'
to
'config';$cfg['Servers'][$i]['user'] = 'user'
and
$cfg['Servers'][$i]['controluser'] = 'root'
to
$cfg['Servers'][$i]['controluser'] = 'user'
Solved my Problem.
Upvotes: 2
Reputation: 161
all you have to do is stopping
mysqld.exe
from the task manager and restart the server (Xammp)
Upvotes: 16
Reputation: 3035
I'm using MAMP, but looks like the exact same issue.
I changed my root password via phpMyAdmin and got locked out as described. I saw this thread and tried to get it working with the new password but the config updates didn't seem to work for me.
I tried to revert, changed the root password back, but it wasn't working, so I hunted around to try and revert my password back to the original. Eventually I discovered that for some strange reason there were multiple root users, root@localhost, [email protected], root@::1!
To get it back working basically I did this:
mysql -u root -p
mysql> use mysql;
mysql> update user set password=PASSWORD("root") where User='root';
mysql> flush privileges;
mysql> quit
After that I removed all the root users other than localhost (using phpMyAdmin), and I could still login... so, not sure why they were there in the first place.
Then, I discovered that MAMP Pro has a button under the MySQL tab that sets the root password. I'm not sure what files it edits, or services it restarts, etc... but it worked.
References:
Upvotes: 0
Reputation: 245
I made changes to the config file for Laravel and completely forgot the changes. After applying everything from this thread, I had no success.
I simply overwrote the config.inc file from another xampp installation and it worked fine.
Upvotes: 1
Reputation: 209
I also have the problem but now solved
$cfg['Servers'][$i]['user'] = 'admin';
- I change the user name from 'root' to 'admin'
Upvotes: 5
Reputation: 11
Best Way is reinstall if you have xampp/wamp/mamp or in linux uninstall and reinstall phpmyadmin by using apt-get
Upvotes: 1
Reputation: 2756
it may be another mysqld instance running and stoped it with:
sudo service mysql stop
Worked for me.
Upvotes: 2
Reputation: 49
If you are facing this issue after changing password in phpmyadmin,
paste the old password (passwd before change) in xampp\phpMyAdmin\config.inc.php
:
$cfg['Servers'][$i]['password'] = '**old password here**';
Hope, it would work :)
Upvotes: -2
Reputation: 593
I also faced the same problem it was because another mysql service was running and in parallel mysql in xampp i was trying to run. So you may check that out if other solutions don't work out. You can stop that by the following command:
sudo service mysql stop
May help few users.
Upvotes: 23
Reputation: 83
I faced this problem as well but i could fix it by going to the folder /xampp/phpmyadmin/config.inc.php
Open config.inc.php, u will find (if no password) ['password']= '' or (if old password) ['password']= '123'
Change the password $cfg['Servers'][$i]['password'] = 'test' and u will be able to access phpmyadmin again :)
Upvotes: 0
Reputation: 425
Put generated password in config.inc.php if you changed root user password. I was repeatedly putting password that it asks in phpmyadmin and not generated password.
Being a noob in php and just starting out in xampp, I changed root user password and phpmyadmin has generate password button which generates password that's suppose to get updated in config.inc.php files line but it didn't so I manually updated it.
$cfg['Servers'][$i]['password'] = 'dRHfGtwfJXhzC96M';
On the other hand, this might also help, it involves adding a line to resetroot.bat
Upvotes: 1
Reputation: 209
Opsss. after I change user to 'admin', it doesn't have privelege to add database.. so I change back the user to 'root'.
Then I change the password from the browser.
Go to http://localhost/security/ and then click on the link http://localhost/security/xamppsecurity.php . After that change pasword for superuser to 'root'.
After that open your http://localhost/phpmyadmin/
Now it works.
Upvotes: 15
Reputation: 591
I also had the same problem and it tooks me several hours to figured out.
I just changed 'config' to 'cookie'
$cfg['Servers'][$i]['auth_type'] = 'config';
Upvotes: 59
Reputation: 1
if you are using google chrome you can fix the problem via , trying any one of the steps mentioned on this page but you need to clear your whole browsing history .... clear all the data that chrome saved onto your computer by pressing ctrl+h and the clearing all the browsing data select all the fields now restart php my admin and all will work
Upvotes: -2
Reputation: 711
I have been confronted with the same problem, so I went to :
/xampp/phpmyadmin/config.inc.php
I pasted the password which I had enter earlier then I was able to access phpmyadmin again, there in the privileges tab/ edit/ I chose no password and go then it all came back to life :)
Also you can change the user to admin but your phpmyadmin would be in admin side and your other localhost website will not work either.
Upvotes: 71
Reputation: 227
I also had that problem and i did what hairul said:
then i restarted mysql on the xampp control panel and didn t work.
It only worked when i restarted my computer!!!!
Upvotes: -1
Reputation: 17384
The above code fixed problem for most of the ppl but I still could not login. Finally I found this (line#9 in the above code needs to be changed)
$cfg['Servers'][$i]['AllowNoPassword'] = true; <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false; <--- to this fixed the problem.
Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.
Upvotes: 23