I have phpMyAdmin installed on my local machine. How can I make it connect to an external server?
Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin. Log in to phpMyAdmin by using the following credentials: Username: root. Password: application password.
Create MySQL Database at the LocalhostOpen your browser and go to localhost/PHPMyAdmin or click “Admin” in XAMPP UI. Now click Edit privileges and go to Change Admin password, type your password there and save it. Remember this password as it will be used to connect to your Database.
In the config file, change the "host" variable to point to the external server. The config file is called config.inc.php
and it will be in the main phpMyAdmin folder. There should be a line like this:
$cfg['Servers'][$i]['host'] = 'localhost';
Just change localhost
to your server's IP address.
Note: you may have to configure the external server to allow remote connections, but I've done this several times on shared hosting so it should be fine.
To set up an external DB and still use your local DB, you need to edit the config.inc.php file:
On Ubuntu: sudo gedit /etc/phpmyadmin/config.inc.php
The file is roughly set up like this:
if (!empty($dbname)) { //Your local db setup $i++; }
What you need to do is duplicate the "your local db setup" by copying and pasting it outside of the IF
statement I've shown in the code below, and change the host to you external IP. Mine for example is:
$cfg['Servers'][$i]['host'] = '10.10.1.90:23306';
You can leave the defaults (unless you know you need to change them)
Save and refresh your PHPMYADMIN login page and a new dropdown should appear. You should be good to go.
EDIT: if you want to give the server a name to select at login page, rather than having just the IP address to select, add this to the server setup:
$cfg['Servers'][$i]['verbose'] = 'Name to show when selecting your server';
It's good if you have multiple server configs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With