Skip to content

Commit d1e4ba4

Browse files
committed
add custom cnf
1 parent 33d86e7 commit d1e4ba4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

init/30_config.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ sed -i -e 's/\(user.*=\).*/\1 abc/g' /etc/mysql/my.cnf
1111
sed -i -e "s#\(datadir.*=\).*#\1 $DATADIR#g" /etc/mysql/my.cnf
1212
sed -i "s/user='mysql'/user='abc'/g" /usr/bin/mysqld_safe
1313

14+
# setup custom cnf file
15+
[[ ! -f /config/custom.cnf ]] && cp /defaults/my.cnf /config/custom.cnf
16+
[[ ! -L /etc/mysql/conf.d/custom.cnf && -f /etc/mysql/conf.d/custom.cnf ]] && rm /etc/mysql/conf.d/custom.cnf
17+
[[ ! -L /etc/mysql/conf.d/custom.cnf ]] && ln -s /config/custom.cnf /etc/mysql/conf.d/custom.cnf
18+
1419
# set permissions
1520
chmod -R 777 /var/run/mysqld

0 commit comments

Comments
 (0)