How do I get MySQL to read my.cnf again without rebooting?

Is there such a command?

I changed my.cnf and I don't want to stop / start MySQL.

+2


source to share


3 answers


As far as I know you need to restart the MySQL server, but there are some configuration variables that can be changed without restarting: dynamic system variables



+2


source


As far as POSIX is concerned, SIGHUP (which usually tells a program to run in the background after reloading its configuration) clears privileges. Link here . In fact, as it should be, if you started a foreground service and shut down, you probably want it to happen.

This leaves us with SIGUSR (1 or 2) who were aware of the service crash .

In short, take advantage of the tools provided :) Anytime you are dealing with a service that uses a more primitive IPC , it is a good idea to simply restart the service when the configuration changes. Many treadmills must complete their work, die, and be reborn. Another race for mutual exclusive blocking will take more time than just renewing it, given that each running stream will have to change its behavior and understanding of its universe in situ . This leads to a dead end, fast and zombie parent.



Be aware that most DBMSs use their own buffering, which is usually handled by the kernel for most other services. You cannot just ask a thread to speak Spanish when it once spoke English, or vice versa, depending on what you changed in the configuration.

At least not without parent reincarnation .. so just run.

+3


source


Install RubyGem mysql_manager

( sudo gem install mysql_manager

) and then run the command:

mysql-manager --reload-my-cnf --reload-my-cnf:config /etc/my.cnf --log:level DEBUG

      

For more options, run mysql-manager --help

.

You may need to specify an alternative --db:dsn

, --db:username

or --db:password

.

Read more about this here: https://github.com/osterman/mysql_manager

0


source







All Articles