Working remotely with mysql from local centos

Solution 1:

Couple of ways I've done this in the past

  1. scp "your script" to the remote server then run it over ssh
ssh remote server 'bash -c "./path/to/script"'
  1. Port forward the remote hosts mysql port of 3306 to your local host 3333
ssh -L 3333:remote_server_name_or_ip:3306

Then, run your script with sql queries and have it point to your localhost:3333