MySQL Said: Cannot Connect: Invalid Settings in XAMP (Resolved)

Last Updated on April 14, 2024 by Roshan Parihar

To resolve the problem of MySQL cannot connect invalid settings in XAMP PHPMyAdmin, you have to edit few contents of config.inc in XAMP server.

It’s an annoying thing on your XAMP server when you try to open PHPMyAdmin to access MySQL databases. Sometimes you will get an error message on your PHPMyAdmin login page with message ‘MySQL said: connot connect: invalid settings’. Below is the screenshot of the message.

xamp-access-denied MySQL Cannot Connect Invalid Settings in XAMP

Let’s solve it with my tested step-by-step working process to quickly resolve the problem.

How to Resolve MySQL Cannot Connect: Invalid Settings in XAMP

Here is the step-by-step process to resolve ‘MySQL said: connot connect: invalid settings’ error:-

Step 1: Go to xamp/phpMyAdmin/config.inc

First of all, go to the location where you have installed the XAMP server on your computer. Visit the XAMP PHPMyAdmin folder xamp/phpMyAdmin/config.inc to get the config.inc file. After that, open the file config.inc on the Notepad++ editor to get its content for editing.

Step 2: Change Server Auth Type to ‘cookie’ Under config.inc File

Further, you will get the line in the file config.inc as shown in the image below.

xamp-config-inc

You have to change the above text to the text shown in the image below. This means you have to change the $cfg['Servers'][$i]['auth_type'] = 'config' to $cfg['Servers'][$i]['auth_type'] = 'cookie'.

xamp-config-to-cookie MySQL Cannot Connect Invalid Settings in XAMP

Now, again go to the PHPMyAdmin login page and refresh the page. The error ‘MySQL said: connot connect: invalid settings’ will not show again. You will get the PHPMyAdmin login page after refreshing the error page.

open-phpmyadmin

Enter the PHPMyAdmin username and password and click the ‘Go’ button to make a login. You will get the new error showing that ‘Cannot log in to the MySQL server’ as shown in the image below.

open-phpmyadmin-when-login-error-again

Step 3: Change Server Host to ‘http://127.0.0.1:3307/’

To resolve the above error PHPMyAdmin login page, you need to again edit the config.inc file.

xamp-config-inc-host MySQL Cannot Connect Invalid Settings in XAMP

You have to change the line $cfg['Servers'][$i]['host'] = '127.0.0.1'; to the text content $cfg['Servers'][$i]['host'] = '127.0.0.1:3307';.

xamp-config-inc-host-to3307

Now, let’s again go to your PHPMyadmin login error page and again click the ‘Go’ button. This time, you will not get any errors and got success to make PHPMyadmin login of your MySQL in the XAMP server.

open-phpmyadmin-when-login-error-again-click-go MySQL Cannot Connect Invalid Settings in XAMP

The below image shows that all the errors are resolved and you can now check your PHPMyadmin database. Now, enjoy working again on your XAMP server to create PHP projects.

xamp-phpmyadmin-login-success MySQL Cannot Connect Invalid Settings in XAMP

That’s all.

Join the Conversation

3 Comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.