Question about MySQL permission effectiveness

Source: Internet
Author: User
Tags mysql query analyzer

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 ';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.