Bug #87287 | 5.7 startup scripts always initialize if empty datadir | ||
---|---|---|---|
Submitted: | 2 Aug 2017 19:20 | Modified: | 6 Oct 2017 18:02 |
Reporter: | Matthew Boehm | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S4 (Feature request) |
Version: | 5.7 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | MySQL, systemd |
[2 Aug 2017 19:20]
Matthew Boehm
[3 Aug 2017 19:49]
Terje Røsten
Just create a file in $datadir when the remote mounting is not done and you should be set or?
[3 Aug 2017 22:21]
Roel Van de Paar
I like Matthew's idea about having to run the init manually. It can still run automatically when it's installed (as part of the packaging script) I suppose, but otherwise it may be a good thing not to do this automatically (if it is - not checked)?
[3 Aug 2017 22:27]
Matthew Boehm
@Terje, how would you accomplish that in an automated manner? Say your mount suddenly disappears (yes, speaking from experience) and MySQL crashes. systemd will auto-restart it. But now, the datadir is empty cause the mount is gone but the dir remains. How will you auto-create this file if the mount goes away to prevent unintended initialize?
[9 Aug 2017 0:28]
Roel Van de Paar
Can this feature request be verified please?
[6 Oct 2017 18:02]
Paul DuBois
Posted by developer: Fixed in 5.7.20, 8.0.4. For platforms that use systemd, the data directory is initialized if empty at server startup. This might be a problem if the data directory is a remote mount that has temporarily disappeared: The mount point would appear to be an empty data directory, which then would be initialized as a new data directory. It is now possible to suppress this automatic initialization behavior. specify the following line in the /etc/sysconfig/mysql file (create the file if it does not exist): O_INIT=true
[7 Oct 2017 12:50]
Paul DuBois
Typo in previous message. /etc/sysconfig/mysql should be: NO_INIT=true