Skip to content

Instantly share code, notes, and snippets.

@jhoffmann
Created August 22, 2014 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhoffmann/d9e3bd4954a1f85454cb to your computer and use it in GitHub Desktop.
Save jhoffmann/d9e3bd4954a1f85454cb to your computer and use it in GitHub Desktop.
~/.my.cnf
function mydb() { /usr/bin/mysql --defaults-group-suffix=$@ ;}
[client]
default-character-set=utf8
host=
user=
password=
database=
[clientstage]
host=
user=
password=
database=
[clientdev]
host=localhost
user=
password=
database=
[clientmkt]
host=localhost
user=
password=
database=
[mysql]
no-auto-rehash
connect_timeout=2
Usage:
mydb [client]
i.e. mydb (uses default params from the top of .my.cnf)
mydb stage (uses the params from the [clientstage] block)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment