Mysql modify/revoke permission _ MySQL

Source: Internet
Author: User
Mysql modify and revoke permissions bitsCN.com

Mysql modify/revoke permissions

For the sake of security, mysql can only log on locally by default. the remote logon permission is disabled. if you need to log on remotely, perform the following configuration:

(1) log on to mysql: [The password can be blank, but this is not safe]

1

Mysql> grant all privileges on dbname. tbname to 'username' @ 'login IP' identified by 'password' with grant option;

2

Dbname = * indicates all databases

3

Tbname = * indicates all tables

4

Login ip = % indicates any ip address

5

Password is blank, indicating that you can log on without a password

(2) update:

1

Mysql> flush privileges

(3) users can log on remotely and only perform specific operations:

1

Mysql> grant select, insert, update, delete on *. * to 'root' @ 'IP' identified by "password ";

(4) revoke permissions:

01

Mysql> revoke privileges on dbname [. tbname] from username;

02

Privileges includes:

03

Alter: modify the database table

04

Create: create a new database or table

05

Delete: delete table data

06

Drop: delete database/table

07

Index: Create/delete an index

08

Insert: Add table data

09

Select: query table data

10

Update: update table data.

11

All: allow any operation

12

Usage: only logon allowed

BitsCN.com

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.