1

I currently have running two MySQL instances on my machine, production and development - I can connect to each one using the following:

mysql --host=127.0.0.1 --port=3306 -u root -p
mysql --host=127.0.0.1 --port=6606 -u root -p

Now I just set up an instance of PhpMyAdmin, but I am having trouble getting it to connect to my Development instance, here is relevant context in config.inc.php

$i = 1;
$cfg['Servers'][$i]['verbose'] = 'Production';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

$i = 2;
$cfg['Servers'][$i]['verbose'] = 'Development';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = 6606;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

When logging on, whether I have Production or Development selected, I am also logged into the Production server running on 3306.

Thoughts?

4
  • Are you seeing an error message? Do you see the second server in the dropdown on the login page?
    – ibennetch
    Jan 10, 2016 at 23:02
  • I see no error messages, and I do see the dropdown. When selecting the secondary in the dropdown, I am always connected to the primary instance.
    – Matt Clark
    Jan 11, 2016 at 1:57
  • Can you temporarily try swapping the server order (which should be as easy as swapping $i = 1; and $i = 2; for now; though if that fails I'd also be curious about whether you completely move the port 6606 server to the first position in the file)? I suspect some problem with your config.inc.php (no idea what, but that seems to be the likely problem); can you paste here the entire file for testing (obscuring any sensitive information)? What phpMyAdmin version is this?
    – ibennetch
    Jan 11, 2016 at 5:01
  • i ran into same problem and after playing around i find out that when i set the loop back ip 127.0.0.1 for the [host] param instead of localhost for the second instance...it recognized it and connected me to the right instance
    – ibrahem
    Nov 3, 2017 at 19:33

1 Answer 1

0

Seems like I need a tutorial to copy paste my code on this fantastic editor. If you know that, pls do make a video out of it.

So, no more difficulties in making. If you find difficult to type the codes from the image, here is the entire config file in Google drive. just open it and use.

https://drive.google.com/file/d/1t3L8CfefKP5eC2GVy-TE2Edx31zGEdy-/view?usp=sharing

Use the code shown in the attached image.

phpmyadmin multiple server access configuration

2
  • 1
    Screenshots make it difficult for others to copy code or edit the answer. Could you please replace it with the text? Aug 25, 2021 at 1:59
  • The editor is terrible to paste code. docs.google.com/document/d/…
    – Alex
    Aug 26, 2021 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.