Today, I encountered a very headache. I used ODBC to grant permissions to a root user, and then used this root user to grant permissions to another user. After searching for a long time, I found the following statement:
Update mysql. User set grant_priv = 'y' where host = '%' and user = 'root ';
Flush privileges;
Grant select, insert, delete, update on cms_20. * To CPMS @ '%' identified by 'cpmsuser ';
Run from top to bottom. There is no problem in the MySQL query analyzer, but ODBC is used for reception. Sometimes the success may fail. It takes me one afternoon to complete the operation, I searched for information on the Internet. The original change in global permissions and password will take effect the next time the customer connects. You need to log on again. Later, we had two ODBC connections to solve this problem! One ODBC execution:
Update mysql. User set grant_priv = 'y' where host = '%' and user = 'root ';
Flush privileges;
Run the following command for another ODBC:
Grant select, insert, delete, update on cms_20. * To CPMS @ '%' identified by 'cpmsuser ';