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 @@ -802,15 +802,28 @@ EOF
802802 # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
803803 sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e " GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER '@'%' identified by '$MYSQL_PASSWORD ';"
804804
805- # 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:
805+ # Update `` my.cnf`` for some local needs and restart the mysql service
806806 if [[ " $os_PACKAGE " = " deb" ]]; then
807- MY_CNF =/etc/mysql/my.cnf
807+ MY_CONF =/etc/mysql/my.cnf
808808 MYSQL=mysql
809809 else
810- MY_CNF =/etc/my.cnf
810+ MY_CONF =/etc/my.cnf
811811 MYSQL=mysqld
812812 fi
813- sudo sed -i ' s/127.0.0.1/0.0.0.0/g' $MY_CNF
813+
814+ # Change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0)
815+ sudo sed -i ' /^bind-address/s/127.0.0.1/0.0.0.0/g' $MY_CONF
816+
817+ # Set default db type to InnoDB
818+ if grep -q " default-storage-engine" $MY_CONF ; then
819+ # Change it
820+ sudo bash -c " source $TOP_DIR /functions; iniset $MY_CONF mysqld default-storage-engine InnoDB"
821+ else
822+ # Add it
823+ sudo sed -i -e " /^\[mysqld\]/ a \
824+ default-storage-engine = InnoDB" $MY_CONF
825+ fi
826+
814827 restart_service $MYSQL
815828fi
816829
You can’t perform that action at this time.
0 commit comments