1. Zhang Huangbin
  2. iredmail

Source

iredmail / iRedMail / functions / mysql.sh

Diff from to

File iRedMail/functions/mysql.sh

  • Ignore whitespace
         ECHO_DEBUG "Grant access privilege from ${LOCAL_ADDRESS} ..."
         mysql -u${MYSQL_ROOT_USER} <<EOF
 -- Set root password
-UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWD}') WHERE User = 'root';
+USE mysql;
+UPDATE user SET Password = PASSWORD('${MYSQL_ROOT_PASSWD}') WHERE User = 'root';
 -- Allow access from SQL_HOSTNAME with password
 GRANT ALL PRIVILEGES ON *.* TO '${MYSQL_ROOT_USER}'@'${SQL_HOSTNAME}' IDENTIFIED BY '${MYSQL_ROOT_PASSWD}';
+-- Allow GRANT privilege
+UPDATE user SET Grant_priv='Y' WHERE User='${MYSQL_ROOT_USER}' AND Host='${SQL_HOSTNAME}';
 EOF
     fi