Print

Print


Dear All,

The following trick works to create a tunnel with ssh to connect to the jmysql database at Jlab.

Step 1 - Setup ssh tunnel:

ssh -L 13306:jmysql.jlab.org:3306  login.jlab.org

(Provide your password when prompted. You can use: ssh -L 13306:jmysql.jlab.org:3306  [log in to unmask]  to specify a different use. You can use another number for 13306, this will be your local port number. You can use 3306 here IF you are NOT also running a MySQL db on your local machine.)


Step 2 - Test connection using mysql:

mysql -h 127.0.0.1 -P 13306 -u hpsuser --password=darkphoton  hps

This will connect you to the hps database on jmysql. Any program using port 13306 on 127.0.0.1 can now connect to the database as if it was local.

Note: the -h 127.0.0.1 is critical. If you use -h localhost, then mysql will try to use a local socket and fail. 


Cheers,

	Maurik
########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1