aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/mysql/S97mysqld9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/mysql/S97mysqld b/package/mysql/S97mysqld
index 5a660e9424..110ca2cd12 100644
--- a/package/mysql/S97mysqld
+++ b/package/mysql/S97mysqld
@@ -1,10 +1,15 @@
#!/bin/sh
+MYSQL_DIR="/var/mysql"
+MYSQL_USER="mysql"
+
+[ -r /etc/default/mysql ] && . /etc/default/mysql
+
case "$1" in
start)
- if [ ! -d /var/mysql/mysql ] ; then
+ if [ ! -d $MYSQL_DIR/mysql ] ; then
echo "Creating MySQL system tables..."
- mysql_install_db --user=mysql --ldata=/var/mysql
+ mysql_install_db --user=$MYSQL_USER --ldata=$MYSQL_DIR
fi
# mysqld runs as user mysql, but /run is only writable by root