Skip to content

Instantly share code, notes, and snippets.

@uladkasach
Last active July 15, 2017 02:03
Show Gist options
  • Save uladkasach/70cf3238cb5a028bb47da15f2b8bf8e1 to your computer and use it in GitHub Desktop.
Save uladkasach/70cf3238cb5a028bb47da15f2b8bf8e1 to your computer and use it in GitHub Desktop.
Instructions for connecting phpmyadmin to a remote server w/ ssh tunnel
# https://degreesofzero.com/article/manage-remote-mysql-servers-with-local-phpmyadmin.html
# open tunnel
ssh -fNL 3307:localhost:3306 USERNAME@HOST
# test tunnel
ps aux | grep ssh
# on local, open myadmin config
sudo nano /etc/phpmyadmin/config.inc.php
# Add the following after all the existing server configurations:
$cfg['Servers'][$i]['verbose'] = 'Remote Server';// Change this to whatever you like.
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3307';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$i++;
##
ps aux | grep 3306
kill <pid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment