1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2010-2011 OpenWrt.org
10 PROG
='/usr/bin/mysqld'
13 local conf
='/etc/my.cnf'
14 local datadir
="$( sed -nE "s
/^\s
*datadir\s
*=\s
*('([^']*)'|\x22([^\x22]*)\x22|(.*\S))\s*$/\2\3\4/p" "$conf" )"
16 [ -d "$datadir" ] || {
17 logger -s "[ERROR] datadir '$datadir' in '$conf' does not exist"
21 [ -f "$datadir/mysql/tables_priv.MYD" ] || {
22 logger -s "[ERROR] can not detect privileges table, you might need to"
23 logger -s "run 'mysql_install_db
--force' to initialize the system tables"