Description:
Issue with grant statement mentioned in documentation at:
https://dev.mysql.com/doc/refman/5.7/en/mysql-innodb-cluster-working-with-production-deplo...
Details:
--------
[root@innodb1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.7.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT SELECT ON mysql_innodb_cluster_metadata.* TO mon@'%';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> GRANT SELECT ON performance_schema.global_status TO mon@'%';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> GRANT SELECT ON performance_schema.replication_* TO mon@'%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* TO mon@'%'' at line 1
mysql>
mysql>
mysql>
mysql>
mysql> CREATE USER mon@'%' IDENTIFIED BY 'Mysql@123';
Query OK, 0 rows affected (0.62 sec)
mysql> GRANT SELECT ON mysql_innodb_cluster_metadata.* TO mon@'%';
Query OK, 0 rows affected (0.03 sec)
mysql> GRANT SELECT ON performance_schema.global_status TO mon@'%';
Query OK, 0 rows affected (0.03 sec)
mysql> GRANT SELECT ON performance_schema.replication_* TO mon@'%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* TO mon@'%'' at line 1
mysql>
How to repeat:
1. Install MySQL 5.7.18
2. Create user as per documentation for monitoring. (
https://dev.mysql.com/doc/refman/5.7/en/mysql-innodb-cluster-working-with-production-deplo...)
Suggested fix:
CREATE USER cluster_mon@'%' IDENTIFIED BY 'Monitor@123';
GRANT SELECT ON mysql_innodb_cluster_metadata.* TO cluster_mon@'%';
GRANT SELECT ON performance_schema.global_status TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_applier_configuration TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_applier_status TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_applier_status_by_coordinator TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_applier_status_by_worker TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_connection_configuration TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_connection_status TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_group_member_stats TO cluster_mon@'%';
GRANT SELECT ON performance_schema.replication_group_members TO cluster_mon@'%';