Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fcaldarelli/4b059fb30b48eb1d679ff68ec875bddd to your computer and use it in GitHub Desktop.
Save fcaldarelli/4b059fb30b48eb1d679ff68ec875bddd to your computer and use it in GitHub Desktop.
# From Docker container
ssh -nNT -L /var/run/mysqld/mysqld.sock:remotehost:3306 -i <cert.pem> ubuntu@ssh_host
# From Docker container, php config
$db = new PDO( sprintf("mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=%s", $config['db']['database']), $config['db']['username'], $config['db']['password']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment