File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -797,15 +797,28 @@ EOF
797
797
# Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
798
798
sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e " GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER '@'%' identified by '$MYSQL_PASSWORD ';"
799
799
800
- # Edit /etc/mysql/ my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
800
+ # Update `` my.cnf`` for some local needs and restart the mysql service
801
801
if [[ " $os_PACKAGE " = " deb" ]]; then
802
- MY_CNF =/etc/mysql/my.cnf
802
+ MY_CONF =/etc/mysql/my.cnf
803
803
MYSQL=mysql
804
804
else
805
- MY_CNF =/etc/my.cnf
805
+ MY_CONF =/etc/my.cnf
806
806
MYSQL=mysqld
807
807
fi
808
- sudo sed -i ' s/127.0.0.1/0.0.0.0/g' $MY_CNF
808
+
809
+ # Change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0)
810
+ sudo sed -i ' /^bind-address/s/127.0.0.1/0.0.0.0/g' $MY_CONF
811
+
812
+ # Set default db type to InnoDB
813
+ if grep -q " default-storage-engine" $MY_CONF ; then
814
+ # Change it
815
+ sudo bash -c " source $TOP_DIR /functions; iniset $MY_CONF mysqld default-storage-engine InnoDB"
816
+ else
817
+ # Add it
818
+ sudo sed -i -e " /^\[mysqld\]/ a \
819
+ default-storage-engine = InnoDB" $MY_CONF
820
+ fi
821
+
809
822
restart_service $MYSQL
810
823
fi
811
824
You can’t perform that action at this time.
0 commit comments