1

I installed XAMPP and phpMyAdmin was working properly after the installation. But after finishing my work, when I restart my computer, the phpMyAdmin page says access denied and gives an error message, saying "Cannot connect: invalid settings".

Cannot connect: invalid settings

I did not change the username or password. I reinstalled XAMPP many times. It works properly after reinstalling, but it stops working after restarting my computer. The version is 5.5.38.

JoSSte
  • 2,953
  • 6
  • 34
  • 54
Karthikeyan
  • 31
  • 2
  • 4
  • using your xampp controll panel, can you actually see mysql is running? – davejal Feb 02 '17 at 03:03
  • I think this question is better asked at superuser instead of stackoverflow – davejal Feb 02 '17 at 03:04
  • 1
    Just out of curiosity, are you running Skype? It (or another program) may be conflicting with your XAMP server. Try starting the server before all other programs after boot up (including auto-start programs). – Sablefoste Feb 02 '17 at 03:16
  • This question has multiple answers, did none of them work for you? http://stackoverflow.com/q/7180893/3664960 – davejal Feb 02 '17 at 04:06
  • another one http://stackoverflow.com/q/1276538/3664960 – davejal Feb 02 '17 at 04:08
  • and finally http://stackoverflow.com/q/26825579/3664960 – davejal Feb 02 '17 at 04:09
  • Both mysql and apache servers running. Of course I saw all of the answers related to this question, they are all about password change. None of them worked for me. I did not change the password in the first place. @davejal – Karthikeyan Feb 02 '17 at 05:25
  • Have you asked the XAMPP people for assistance with this? It sounds like something specific to the XAMPP package because there's nothing in MySQL or phpMyAdmin that should revert after a restart. – Isaac Bennetch Feb 03 '17 at 14:27
  • it sounds like there are several mysql installations and the one thast comes up after a restart is not the one you expect. – JoSSte Jul 31 '23 at 10:04

3 Answers3

1

I had a similar problem with MAMP when I first started using it.

There was a file called config.inc.php that I had to edit. This question might help you, it's pretty much the exact thing I did to fix it.

This link will take you to the XAMPP equivalent answer to what I used for MAMP: XAMPP MySQL password setting (Can not enter in PHPMYADMIN)

Specifically this part: (Couldn't get the code in the blockquote)

From "Xampp/phpmyadmin" directory in config.inc.php file find the below code. And follow the given instructions below. I have tried like this and I was successful to run both localhost/phpMyAdmin on browser, MySQL Command prompt as well as MySQL query browser.

$cfg['Servers'][$i]['auth_type']    = 'config';
$cfg['Servers'][$i]['user']         = 'pma';
$cfg['Servers'][$i]['password']     = '';
$cfg['Servers'][$i]['controluser']  = 'user_name/root';
$cfg['Servers'][$i]['controlpass']  = 'passwaord';

And replace the above each statement with the below each corresponding code.

$cfg['Servers'][$i]['auth_type']    = 'config';
$cfg['Servers'][$i]['user']         = 'root';
$cfg['Servers'][$i]['password']     = 'Muhammad Ashikuzzaman';
$cfg['Servers'][$i]['controluser']  = 'root';
$cfg['Servers'][$i]['controlpass']  = 'Muhammad Ashikuzzaman';

Basically, I had to change the file from the defaults to my username and password. After that I never had another login error.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Jenny Holder
  • 63
  • 1
  • 11
  • Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. [answer] – davejal Feb 02 '17 at 03:27
  • Thanks for the tips :) I just changed it. – Jenny Holder Feb 02 '17 at 03:38
  • I actually think the OP's server doesn't start up after boot, maybe he didn't install it as a service, but the OP didn't reply anymore – davejal Feb 02 '17 at 03:45
  • I'm not too familiar with XAMPP but if it's like MAMP I thought you had to have the servers up to open the myPHPadmin page and get that error. If the servers are down I get an error like this when trying to open myPHPadmin: This site can’t be reached localhost refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED – Jenny Holder Feb 02 '17 at 03:52
  • on windows I had times apache/nginx started with windows when installed with standard options and Mysql would need to install a service to be started at boot. If you didn't do that apache is started but MySQL isn't. – davejal Feb 02 '17 at 03:54
  • One last thing, I thought if the error said "Welcome to myPHPadmin!, mySQL said 'cannot connect: invalid settings" then that means mySQL is running to have "said" anything at all? I'm just trying to learn how this works. :) – Jenny Holder Feb 02 '17 at 03:58
  • I'm no expert either. But PHPMyadmin is just php code. In the finer prints it says cannot connect (doesn't have to be actually the server returning the message). The the last sentence it says to check `host, username and password`. So either the host isn't running (the server) or the credentials are wrong. That's my take on it, doesn't have to be the case – davejal Feb 02 '17 at 04:02
  • maybe you could join a starting discussion here http://stackoverflow.com/q/41994200/3664960 – davejal Feb 02 '17 at 04:27
0

If you don't need any of the features provided by the phpMyAdmin configuration storage, you could edit config.inc.php and remove references to those tables (or, at the least, the lines about controluser, controlpass, and pmadb). If the problem is simply with authenticating the controluser, this will work around that problem.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
0

I use XAMMP on Windows 10.

I had commented these two lines of code.

/* User for advanced features */
//$cfg['Servers'][$i]['controluser'] = 'pma';
//$cfg['Servers'][$i]['controlpass'] = '';

Remove comments and it will work:

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
juanitourquiza
  • 2,097
  • 1
  • 30
  • 52