I've got a development environment, and am trying to access a remote database. Here's the code I'm using:
$dbhost = '127.0.0.1:3307'; $dbuser = 'mydbuser'; $dbpassword = 'mydbpassword'; $dbdatabase = 'mydatabase'; $db=mysql_connect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbdatabase, $db);
I get this error:
[error] [client 127.0.0.1] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
To make that work, I'm trying to SSH from my regular user account (jzumbrum) like this:
ssh -f -L 3307:localhost:3306 firstname.lastname@example.org sleep 10 >> /var/log/apache2/sshlog
What commands exist to verify that the ssh port binding worked correctly?