Set a persistent global MySQL parameter

2019-06-24 09:30发布

问题:

I set the following MySQL parameter:

set global wait_timeout=2147483

However, after server restart it reverted to its default value 28800. Isn't the set command persistent? In order to have this parameter persistent, should I edit a configuration file? Would that file be C:\Program Files\MySQL\MySQL Server 5.5\my.ini? If so, is it simply

wait_timeout=2147483

If so, under which section should it be in my.ini

回答1:

Set global doesn't make persistent variables.

You should write that under [mysqld] section in my.cnf:

[mysqld]
wait_timeout=86400