How to add an additional configuration file for mysql (my.cnf)

I want to add and add a configuration file for MySQL on UNIX, let me have it my2.cnf. Therefore, when MySQL starts, it will also read the parameters of this file.

Here it says that I can put the file in the following places:

  • /etc/my.cnf
  • SYSCONFDIR / my.cnf
  • $ MYSQL_HOME / my.cnf
  • defaults-extra-file The file specified with the -defaults-extra-file = switch, if any
  • ~ / .my.cnf Parameters for the user

I would like something like this "default-extra-file", but not enter this command at the mysql prompt.

Is there an option in the cnf file, for example:

 extra-conf-file=/path/to/my/file/my2.cnf

(Unfortunately this does not work)

? my.cnf , themysql?

( $MYSQL_HOME/my.cnf , , , my.cnf).

+5
1

, , ?

!include /path/to/my/file/my2.cnf

, :

!includedir /path/to/my.cnf.d
+10

All Articles