Use environment variables in my.ini / my.cnf

Is it possible to read env vars in the MySQL parameter file my.ini / my.cnf, as is possible in httpd.conf and php.ini with the syntax $ {ENVVAR}:

datadir="${MYSQL_DATA_HOME}/Data/" 

If so, what is the syntax?

+4
source share
1 answer

I think that this is impossible. I tried to make the same changes to the MySQL parameter file, but could not start. But there is another way.

Set MYSQL_DATA_HOME=<some dir> in the console. And in the same terminal, start mysql not with service start , but with this command mysqld --datadir=$MYSQL_DATA_HOME/whatever

+5
source

All Articles