Absolutely Tech

[HOWTO] Use local phpmyadmin with remote MySQL


My host recently started allowing remote connections to its mysql database. It was a really useful feature – I could not change database settings from my own computer. Since it started allowing remote connections from my IP, I could use any mysql client to connect to it. I fired up terminal and tried to connect using the command:

mysql --host=69.89.31.242 --user=username --password=password

It connected. This was just to test the connection. I wanted to connect my phpmyadmin with this remote host. For that I edited /etc/phpmyadmin/config-db.php file and changed:

$dbserver=”;

to

$dbserver=’69.89.31.242′;

I loaded the url http://localhost/phpmyadmin, entered the database username and password and I got in. I could administer my database from my local phpmyadmin installation.

Cheers!

Category: MySQL, PHP, Ubuntu (Linux)

Tagged: , , , , , , , ,

  • Martín

    Cool!
    I’m using Arch linux and the config file I had to edit was:
    /etc/webapps/phpmyadmin/config.inc.php
    and change the line:
    $cfg['Servers'][$i]['host'] = ‘localhost’
    to whatever I want and that’s it!

  • Louis_971

    Hello,

    I ‘m trying to deploy LAMP on Linux Centos 6. And I also want to deploy the mysql database on separate remote server and having phpmyadmin connecting to it. However, I’m having I’m having a hard time doing this. I’ have tried several things and I still cannot make phpmyadmin connecting to a remote mysql server.
    Phpmyadmin is installed on the same server as my web server, and both of web server and database server are on centos 6. From my webserver I can connect to my remote mysql server using the shell command prompt, but it never works with phpmyadmin. Both my web server and mysql server are in a small home network with another computer that has windows XP installed on it with WAMP. On this computer when I change config.inc.php file to replace “localhost” in this line “$cfg['Servers'][$i]['host'] = ‘localhost’;” with remote mysql server ip address, and try to connect , it works fine, but never works when I do the same thing from phpmyadmin installed on my web server with Centos 6 Linux.
     
    Can you help me to resolve this please. ?

Ubuntu 11.04

The next version of Ubuntu is coming soon

Follow me

Sponsors