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
797797 # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
798798 sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e " GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER '@'%' identified by '$MYSQL_PASSWORD ';"
799799
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
801801 if [[ " $os_PACKAGE " = " deb" ]]; then
802- MY_CNF =/etc/mysql/my.cnf
802+ MY_CONF =/etc/mysql/my.cnf
803803 MYSQL=mysql
804804 else
805- MY_CNF =/etc/my.cnf
805+ MY_CONF =/etc/my.cnf
806806 MYSQL=mysqld
807807 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+
809822 restart_service $MYSQL
810823fi
811824
You can’t perform that action at this time.
0 commit comments