Give .my.cnf at mysql command line

How to specify a specific .my.cnf configuration file in mysql command line?

 $ mysql --my-config = .my.cnf
+8
command-line mysql
source share
2 answers

The --defaults-file parameter allows you to specify which parameter files you want to use. It would be nice to give it the full path to your options file.

mysql --defaults-file=/home/user/.my.cnf database 
+21
source share

Here: http://dev.mysql.com/doc/refman/5.5/en/option-files.html says that you can also specify "defaults-extra-file" for additional parameters. Otherwise, the default value is my.cnf (depending on the OS).

+4
source share

All Articles