Give .my.cnf to mysql command line

36,106

Solution 1

The --defaults-file option lets you specify which options file you want to use. It would be a good idea to give it the full path to your options file.

mysql --defaults-file=/home/user/.my.cnf database

Solution 2

In here: http://dev.mysql.com/doc/refman/5.5/en/option-files.html it says you can also specify "defaults-extra-file" for additional params. Otherwise it defaults to the various my.cnf (depending on OS).

Share:
36,106
Philippe Blayo
Author by

Philippe Blayo

One of the best experience in my life has been to enjoy pair programming with developers that value clean code and simple design. It's called eXtreme Programming and I hope one day I'll have the opportunity to do it again.

Updated on July 13, 2022

Comments

  • Philippe Blayo
    Philippe Blayo 4 months

    How to give a specific .my.cnf config file to the mysql command line?

    $ mysql --my-config=.my.cnf