2016-11-21 02:50:30 +00:00
|
|
|
#!/bin/bash
|
2016-11-14 06:47:40 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
shutdown_mysql() {
|
|
|
|
if [[ -d /var/run/mysqld/mysqld.sock ]]; then
|
2016-11-21 02:50:30 +00:00
|
|
|
mysqladmin -u root shutdown || true
|
2016-11-14 06:47:40 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
trap shutdown_mysql EXIT
|
|
|
|
|
|
|
|
mkdir -p /var/run/mysqld
|
|
|
|
chown mysql:mysql /var/run/mysqld
|
|
|
|
|
2016-11-21 02:50:30 +00:00
|
|
|
rm -f /var/lib/mysql/aria_log_control
|
|
|
|
|
|
|
|
/sbin/setuser mysql /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 >/var/log/mysql.log 2>&1
|