问题
I run XAMPP, a few days back i had set up a password for the root password through phpmyadmin I am not able to access phpMyAdmin ever since that moment
I followed help on this link but everything seems fine there (in config.inc.php). I even tried unistalling xampp fully, restarting windows and then reinstalling xampp, but still pointing to localhost/phpmyadmin I get the following error
MySQL said:
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 Also tried to reset root password through mysqld.bat as given on mysql\'s website help but to no avail
Please Help! Here\'s a screenshot describing the situation:
回答1:
Go inside your phpMyAdmin directory inside XAMPP installation folder. There will be a file called config.inc.php. Inside that file, find this line:
$cfg['Servers'][$i]['password'] = '';
you must make sure that this field has your mysql root password (the one that you set).
回答2:
PHPMYADMIN - Cannot connect: invalid settings.
I also faced similar issue but now I found a fix.
For wamp server:
IN: C:\wamp\apps\phpmyadminVERSION\config.inc.php
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;
For xampp server:
because of xampp server had the following settings.
C:\xampp\phpMyAdmin\config.inc.php
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''; // which is default setting in xampp server
$cfg['Servers'][$i]['password'] = 'your password';//type your password you have changed
回答3:
I had a similar problem not being able to access phpmyadmin on a testing server after changing the root password. I tried everything mentioned above, including advice from other forums, using all kinds of variations to the config files. THEN I remembered that Google Chrome has some issues working with a testing server. The reason is that Chrome has a security feature to prevent local hard drive access from a remote website - unfortunately this can cause issues in a testing environment because the server is a local hard drive. When I tried to log in to phpmyadmin with Internet Explorer it worked fine. I tried several tests of Chrome v IE9, and Chrome would not work under any configuration with the root password set. I also tested Firefox it also worked fine, the issue is only with Chrome. My advice: if you're on a testing server make sure your config file has the correct settings as described above, but if the problem continues and you're using Chrome try a different browser.
回答4:
Step 1: Go to
http://localhost/security/xamppsecurity.php
Step 2: Set/Modify your password.
Step 3: Open C:\xampp\phpMyAdmin\config.inc.php using a editor.
Step 4: Check the following lines:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'your_password';
// your_password = the password that you have set in Step 2.
Step 5: Make sure the following line is set to TRUE: $cfg['Servers'][$i]['AllowNoPassword'] = true;
Step 6: Save the file, Restart MySQL from XAMPP Control Panel
Step 7: Login into phpmyadmin with root & your password.
Note: If again the same error comes, check the security page:
http://localhost/security/index.php
It will say:
The MySQL admin user root has no longer no password SECURE
PhpMyAdmin password login is enabled. SECURE
Then Restart your system, the problem will be solved.
回答5:
Apply these changes in phpmyconfig/config.inc. Type in your username and password that you have set:
$cfg['Servers'][$i]['user'] = 'user';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
This works for me.
回答6:
I faced the same problem after executing the following command in mysql
UPDATE mysql.user SET Password=PASSWORD('blablabla') WHERE User='root'; FLUSH PRIVILEGES;
what I did:
open cmd
type
cd c:\xampp\mysql\bin mysql.exe -u root --password
after that mysql will prompt u
Enter password:blablabla
once youre in mysql, type
UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root'; FLUSH PRIVILEGES;
Note: this time the password is left empty...
make sure in your config.inc.php the following is set
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
after that I can see my phpmyadmin...
回答7:
I had similar problem. Difference was that I was getting this error for only one database out all my databases. I removed the password , restarted mysql many times and still it dint work :(
And when I cleared the cache of my browser it just started working !!!
This one really screwed my mind !
回答8:
I had this same problem using the Windows XAMPP 1.7.4 -- after setting a password for mysql, I could no longer access phpMyAdmin. I changed the password in config.inc.php from ' ' to the new mysql password, and changed AllowNoPassword from true to false. I still couldn't log in.
However, I saw that there is also a config.inc.php.safe file, and when I also edited the password settings in THAT file I was subsequently able to log in to phpMyAdmin.
回答9:
I'm one of the noob too when I encountered something like this. So... I set the passwords using the command security page gave me: /opt/lampp/lampp security Then I used password xyz for all the passwords... Then when I go to site/, it ask for a basic authentication. But when I tried root//xyz, it does not allow me login. So, after some digging, it turns out the xyz password was set for a default user named 'lampp'. When I tried to login using lampp//xyz, it worked like a charm.
The issue is that they made an assumption that everyone knows to use lampp//rootpw as their login o.O And... that is a basic auth for the directory! not pw for phpmyadmin or pw for mysql...
回答10:
1) Go to your Xampp Root folder
For Ex : C:xampp/phpmyadmin/config.inc.php
2) In that find the following :
$cfg['servers'][$i]['password'] = '';
3) Here enter which password you set.
Ex : $cfg['servers'][$i]['password'] = '1234';
4) Then Save it and Restart your Xamp server.
回答11:
This works for me:
C:\xampp\phpMyAdmin\config.inc.php
$cfg['Servers'][$i]['password'] = 'secret';
Edit: Before you got this error it is most likely that from phpmyadmin->Users you have added password for the root user. In my case that was "secret" so the above primer works for me BUT for you will work this:
$cfg['Servers'][$i]['password'] = 'Enter the password for root you have added before you got this error';
回答12:
For AMPPS, I have to add this is my phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Note: In Ubuntu, I had to locate where the file is and I used locate config.inc.php
This answer is only meant for local, development purposes :)
来源:https://stackoverflow.com/questions/1276538/phpmyadmin-cant-connect-invalid-setings-ever-since-i-added-a-root-passwor