Reputation: 769
I have been searching for a right answer and no luck with solutions. I have WampServer and phpMyAdmin on my localhost. I have created a user in phpmyadmin on remote server with all privilages.
And tried to connect it to the remote databases with the following code:
<?php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$i++;
/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'mypass';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'example.com';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
?>
And, as a result, in phpMyAdmin now I have 2nd server, but when I choose it - an error pops-up. MySQL error #2002 that looks like this:
Please help what am I missing!
Upvotes: 2
Views: 3974
Reputation: 4367
You are suffering from a failure of communication between your machine and the server. If it was permission, you wouldn't get a dead request, you would get the permission error.
Upvotes: 2
Reputation: 517
You have 2 connections listed there so it will show 2 connections.
So for your current config the 2nd server listed is trying to connect to "example.com" server if you are trying to connect to this server make sure you have allowed remote connection's set up, and account privileges also for remote access.
If your not trying to connect to "example.com" change these lines to the remote host you want to connect to.
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'mypass';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'example.com';
You may need to add in port as well
$cfg['Servers'][$i]['port'] = '3307'; // MySQL port
Upvotes: 0