[nycbug-talk] mysql client and .my.cnf

George Georgalis george
Wed Nov 9 17:01:47 EST 2005


On Wed, Nov 09, 2005 at 04:08:17PM -0500, Okan Demirmen wrote:
>On Wed 2005.11.09 at 15:53 -0500, csnyder wrote:
>> 
>> alias db01='mysql -h db01.example.com -u first_database_user -p
>> my_first_database'
>
>yea. i'm using all sorts of aliases...keeping them in sync with "mysql",
>"mysqldump", "mysqladmin", etc becomes a pain...hence i wanted some of
>it in .my.cnf file(s).

in that case us env varables and functions...

db01='-h db01.example.com -u first_database_user -p my_first_database'
db02='-h db01.example.com -u first_database_user -p my_first_database'
export db01 db02

_mysqldump () { mysqldump $1 }
_mysqladmin () { mysqladmin $1 }

_mysqldump $db01

...never tried that, YMMV. but a .ssh/config like cnf file would
be much better, actually I thought it did that, but never tried
that either. ;)

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:george at galis.org




More information about the talk mailing list