This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8931|Reply: 2

[Source] Mysql creates a read-only account

[Copy link]
Posted on 8/1/2020 10:32:28 AM | | | |
mysql to create read-only accounts;

1. Query all account information



2. Create an account and authorize the SELECT query permission.

Note that username/password refers to the username and password in the command, please specify it yourself. If you want to restrict access to Mysql to only specified IPs, change % to IP.

3. Refresh the mysql permissions to make the user creation and authorization effective.

4. Permissions to add views:


Syntax:

GRANT privileges
    ON table [ ( column [, ...] ) ] [, ...]
    TO { PUBLIC | username [, ...] } [ WITH GRANT OPTION ]






Previous:SSIS Tutorial (2) Visual Studio 2019 (VS2019) Install SSIS
Next:I purchased the invitation code and registered successfully, and I was asked to upload three resources
 Landlord| Posted on 8/1/2020 12:05:06 PM |
Error Code: 1064. 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 'IDENTIFIED BY "123456"' at line 1


mysql version 8.0.13, when granting permission to new users, changes:

Correct statement:

 Landlord| Posted on 8/1/2020 12:10:12 PM |
-- Gives test1 read-only permissions to all databases and tables



-- Only allow test2 to read the new_table table of the housecommunity_db database


Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com