Source

iredmail / iRedMail / functions / mysql.sh

Diff from to

File iRedMail/functions/mysql.sh

 CREATE DATABASE IF NOT EXISTS ${VMAIL_DB} CHARACTER SET utf8;
 
 /* Permissions. */
-GRANT SELECT ON ${VMAIL_DB}.* TO "${VMAIL_DB_BIND_USER}"@localhost IDENTIFIED BY "${VMAIL_DB_BIND_PASSWD}";
-GRANT SELECT,INSERT,DELETE,UPDATE ON ${VMAIL_DB}.* TO "${VMAIL_DB_ADMIN_USER}"@localhost IDENTIFIED BY "${VMAIL_DB_ADMIN_PASSWD}";
+GRANT SELECT ON ${VMAIL_DB}.* TO "${VMAIL_DB_BIND_USER}"@"${SQL_HOSTNAME}" IDENTIFIED BY "${VMAIL_DB_BIND_PASSWD}";
+GRANT SELECT,INSERT,DELETE,UPDATE ON ${VMAIL_DB}.* TO "${VMAIL_DB_ADMIN_USER}"@"${SQL_HOSTNAME}" IDENTIFIED BY "${VMAIL_DB_ADMIN_PASSWD}";
 
 /* Initialize the database. */
 USE ${VMAIL_DB};