Symptoms
webmail-config package (re)installation task fails with the output:
Command '/bin/sh -c mysql -D'mysql' -u'root' -p'******' -h'192.0.2.2' < /tmp/horde.install.sql ' execution failed with code 1: ERROR 1130 (00000): Host '192.0.2.2' is not allowed to connect to this MySQL server
Cause
Incorrect user and host rights on the webmail node. MySQL service specific migration instructions were not completed in full, so the original rights were not restored.
Resolution
- Access the node in question (webmail node in this example).
- Connect to the MySQL server with user root and the password configured originally.
Check the current privileges of the 'root' user:
mysql> use mysql mysql> select * from user where User = 'root';
Assign full privileges to the user:
mysql> GRANT ALL ON *.* to root@'192.0.2.2' IDENTIFIED BY 'XXXXXXXXX'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
Try to simulate the task activity:
[root@webmail01 ~]# mysql -u root -p -h192.0.2.2 < /tmp/horde.install.sql Enter password: ERROR 1044 (42000) at line 7: Access denied for user 'root'@'192.0.2.2' to database 'horde'
In case it still fails as above, it is needed to check the
Grant_priv
privelege specifically:mysql> SELECT `User`, `Grant_priv` FROM `mysql`.`user` WHERE `User` = 'root'; +------+------------+ | User | Grant_priv | +------+------------+ | root | Y | | root | Y | | root | Y | | root | Y | | root | Y | | root | N | +------+------------+
If there is at least one 'N' entry, fix it:
mysql> UPDATE `mysql`.`user` SET `Grant_priv` = 'Y' WHERE `User` = 'root'; Query OK, 1 row affected (0.00 sec) Rows matched: 6 Changed: 1 Warnings: 0 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
- Re-run the task, it should end successfully.