Krrish
Krrish

Reputation: 13

phpmyadmin - Cannot connect: invalid settings

I am struggling it since hours, this is how the setup is:

  1. I installed XAMPP stack on a PC. It already had a software which installed MySQL under c:/program files/MySQL/MySQL Server 5.0. If I go to services.msc I can see two MySQL services running automatically "mysql" and "MySQLxxxx" (xxxx is name of the software).

  2. Initially MySQL service wasn't running via control panel. I changed its port to 3307 in my.ini (as my.ini in program files/mysql had port set to 3306) and "service and port settings". It runs now in XAMPP control panel.

  3. I still can't access localhost/phpmyadmin page. It says:

Error MySQL said: Documentation 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.

=================

What am I missing? How to resolve this issue?

Edit1: Added extra information

Edit2: I changed $cfg['Servers'][$i]['auth_type'] (in config.inc.php) from config to http, now it prompts for username/password but when I enter them ('root' and 'password') it doesn't accept them.

Upvotes: 0

Views: 1355

Answers (1)

Isaac Bennetch
Isaac Bennetch

Reputation: 12412

Since you've changed the port MySQL is using, you have to tell phpMyAdmin -- and all your other applications -- about this change.

For phpMyAdmin, edit or add a line like $cfg['Servers'][$i]['port'] = '3007';

Since you're running two MySQL instances, you can connect to both from phpMyAdmin; adapted from the wiki:

<?php 
$cfg['blowfish_secret']='0987654321'; //any string of your choice (max. 46 characters)
$i = 0;  

$i++; // server 1 
$cfg['Servers'][$i]['verbose']   = 'Production server'; 

$i++; // server 2
$cfg['Servers'][$i]['port'] = '3007';
$cfg['Servers'][$i]['verbose']   = 'Development server'; 

By the way, I prefer the auth_type 'cookie' for a few reasons; it can give better error reporting if something goes wrong when connecting, it makes it easier to switch between users and servers, and I dislike the modal dialog my browser presents for http basic authentication. Of course, you're welcome to use whatever you prefer.

Upvotes: 1

Related Questions