The easiest way to create a new user and grant permissions to MySQL

The easiest way to create a new user and grant permissions to MySQL

Create a user:

create user 'oukele'@'%' identified by 'oukele';

If the information listed below is prompted, you need to refresh the permission table

The MySQL server is running with the --skip-grant-tables option so it cannot execute this st...

Here are the steps:

Extended Learning

Create a new mysql user and grant remote access rights

[root@demo /]# mysql -u root -p #Log in to the server database

Enter password:123xxx

#1. Create a new user testuser with password testuserpass

CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testuserpass';

#2. Create a database testDB

create database testDB;

#3. Execute the command to add testDB permissions for the testuser user

grant all privileges on testDB.* to testuser@localhost identified by 'testuserpass';

#4. Execute the command to add remote access permissions for the testuser user

GRANT ALL PRIVILEGES ON testDB.* TO 'testuser'@'%' IDENTIFIED BY 'testuserpass' WITH GRANT OPTION;

#5. Refresh the permission table

flush privileges;

The above is all the content of this knowledge point. More relevant knowledge points can be found in the related articles below.

You may also be interested in:
  • MySQL permission control detailed explanation
  • Detailed tutorial on how to create a user in mysql and grant user permissions
  • Mysql modify stored procedure related permissions issue
  • How to set remote access permissions in MySQL 8.0
  • How to use DCL to manage users and control permissions in MySQL
  • How to create users and manage permissions in MySQL
  • Example analysis of mysql user rights management
  • Summary of methods for querying MySQL user permissions
  • How to enable remote access permissions in MYSQL
  • Detailed explanation of MySQL user and permission management
  • MySQL permission control details analysis

<<:  How to delete the container created in Docker

>>:  Cross-domain issues in front-end and back-end separation of Vue+SpringBoot

Recommend

How to use Dayjs to calculate common dates in Vue

When using vue to develop projects, the front end...

Two query methods when the MySQL query field type is json

The table structure is as follows: id varchar(32)...

In-depth analysis of MySQL query interception

Table of contents 1. Query Optimization 1. MySQL ...

MySQL statement summary

Table of contents 1. Select database USE 2. Displ...

Django online deployment method of Apache

environment: 1. Windows Server 2016 Datacenter 64...

HTML pop-up div is very useful to realize mobile centering

Copy code The code is as follows: <!DOCTYPE ht...

5 ways to quickly remove the blank space of Inline-Block in HTML

The inline-block property value becomes very usef...

Detailed explanation of Linux commands sort, uniq, tr tools

Sort Tool The Linux sort command is used to sort ...

Common attacks on web front-ends and ways to prevent them

The security issues encountered in website front-...

How to solve the problem of forgetting the root password of Mysql on Mac

I haven't used mysql on my computer for a lon...

Example of creating circular scrolling progress bar animation using CSS3

theme Today I will teach you how to create a circ...