MySQL Permissions settings

Source: Internet
Author: User

The product is landing fast. Can no longer secretly use the root user, the information center of the people to come to the root user confiscated back. Distressed

I can only secretly add a user with full privileges ah haha

First, create a user.

Using Create MySQL; or INSERT into Mysql.user (Host,user,password) VALUES ("localhost", "Test", Password ("passwd"));

But I still recommend GRANT USAGE on * * to ' test ' @ '% ' identified by ' passwd ' with GRANT OPTION; Such an operation.

New good, password also changed, remember to refresh the user flush privileges;

Now you can add permissions, plus permissions There are many types, only to a table of new Ah, only to a database permissions Ah, or all the database permissions have, for example.


For Zhang users, in the remote connection, for the Jydb test this table, the new SELECT and UPDATE permissions: GRANT select,update on jydb.test to [email protected] '% '

If it is any table of Jydb: GRANT select,update on Jydb.*to [email protected] '% '

All tables for all databases: GRANT select,update on *.*to [email protected] '% '

Of course there are delete permissions, this and new permissions are similar as long as the grant to change to the REVOKE to a from, for example

To the Zhang user, in the remote connection, for JYDB test this table, delete the SELECT and UPDATE permissions REVOKE select,update on jydb.test from [email protected] '% '

MySQL Permissions settings

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.