Last active
August 29, 2015 14:14
-
-
Save vaibhaw/42bd044f3711cd9daeb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- To login into mysql through command line similar to connecting ssh hosts | |
| -- write following options in your ~/.my.cnf file | |
| -- Ref # http://dba.stackexchange.com/q/3889 | |
| [clientremote] | |
| host=db_host_ip | |
| user=db_username | |
| password=db_password | |
| database=db_schema | |
| [clientlocal] | |
| host=127.0.0.1 | |
| user=db_username | |
| password=db_password | |
| database=db_schema | |
| -- Use following command on terminal to connect to specific server | |
| mysql --defaults-group-suffix="remote" | |
| -- setup alias in ~/.profile or in ~/.bashrc to avoid typing full text | |
| echo 'alias mysql_remote="mysql --defaults-group-suffix=remote"' >> ~/.profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment