Command-line access to remote MySQL server

Posted by Jerry Krinock on Super User See other posts from Super User or by Jerry Krinock
Published on 2014-05-29T01:18:01Z Indexed on 2014/05/29 3:33 UTC
Read the original article Hit count: 512

Filed under:
|
|

I administer a website on a remote, shared host. My web host offers MySQL, and I am able to access this from my Mac OS X computer using a GUI program, Sequel Pro. That works great.

But I want to script some queries, and Sequel Pro is not scriptable. What should I do?

I've read about tunneling to mysql via SSH. I have shell access to the server, with an SSH key on my Mac, so

ssh [email protected] -p 7978

gets me in. Should tunneling the MySQL port 3306 work? Like this?

ssh [email protected] -L 3306:127.0.0.1:3306

(It "times out" after a minute.)

Do I need to install mysql on my Mac?

© Super User or respective owner

Related posts about osx

Related posts about ssh