Skip to content

Commit af47120

Browse files
committed
Bug#26595288 5.7 STARTUP SCRIPTS ALWAYS INITIALIZE IF EMPTY DATADIR
Add option to skip automatic init, making it possible to opt-out. Default is still to perform init. To skip init, create file /etc/sysconfig/mysql with contents like: NO_INIT=true
1 parent 9864873 commit af47120

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/systemd/mysqld_pre_systemd.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ install_validate_password_sql_file () {
4141
install_db () {
4242
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
4343

44+
# No automatic init wanted
45+
[ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql
46+
[ -n "$NO_INIT" ] && exit 0
47+
4448
local instance=$1
4549
datadir=$(get_option mysqld datadir "/var/lib/mysql${instance:+-$instance}" $instance)
4650
log=$(get_option mysqld 'log[_-]error' "/var/log/mysql${instance:+-$instance}.log" $instance)

0 commit comments

Comments
 (0)