I'm trying to connect to a remote MySQL server via ssh so that I have write-access to export some data. At the moment I can do the following:
- Connect to the remote MySQL using
mysql -u mysqluser -pPASSWORD -h HOSTIP DATABASENAME
- Connect to the machine using
ssh sshuser@HOSTIP
(Note that HOSTIP is the same for ssh and mysql server, but mysqluser and sshuser are different).
However, I cannot connect to remote MySQL via ssh. I tried two things:
- After ssh-ing into the machine, I tried
mysql
in the terminal but it is not installed. - I tried
ssh -L 1234:mysqlhost:3306 sshuser@sshhost
. However, I can only enter mysshpassword
, after which I get ssh-ed in but no connection to MySQL still.
mysql
in the terminal but it is not installed. It's Mac with brew installed, so I triedbrew install mysql
but I got errorError: Cannot write to /usr/local/Cellar
I don't have root access.