Get the App
SLTechnology News&Howtos  ›  Database  › 

How does mysql modify or reclaim permissions

Shulou Source: shulou.com Published: 2022-05-31 18:48:13 09月14日 Update

This article mainly explains "how to modify or reclaim permissions in mysql". Friends who are interested may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to modify or reclaim permissions in mysql".

For security, mysql can only log in locally by default. Remote login permission is turned off. If remote login is required, you can configure it as follows:

(1) Log in to mysql: [password can be empty, but it is not safe]

one

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

two

Dbname=* represents all databases

three

Tbname=* represents all tables

four

Login ip=% stands for any ip

five

Password is empty, indicating that no password is required to log in

(2) Update:

one

Mysql > flush privileges

(3) users can only perform specific operations when logging in remotely:

one

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

(4) Recycling permission:

01

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

02

Privileges includes:

03

Alter: modify tables in the database

04

Create: create a new database or table

05

Delete: deleting table data

06

Drop: delete database / table

07

Index: create / delete indexes

08

Insert: adding table data

09

Select: querying table data

ten

Update: updating table data

eleven

All: allow any operation

twelve

Usage: only login is allowed

At this point, I believe you have a deeper understanding of "how to modify or recycle permissions in mysql". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Data login permissions database security content learning update query practical deeper interest practical password easy to operate method more friends query table Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Xiaomi OPPO Reno vpn NVidia