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

Detailed explanation of nginx request header data reading process

In the previous article, we explained how nginx r...

Summary of MySQL foreign key constraints and table relationships

Table of contents Foreign Key How to determine ta...

vue-admin-template dynamic routing implementation example

Provide login and obtain user information data in...

border-radius is a method for adding rounded borders to elements

border-radius:10px; /* All corners are rounded wi...

Summary of the unknown usage of "!" in Linux

Preface In fact, the humble "!" has man...

Parsing Apache Avro Data in One Article

Abstract: This article will demonstrate how to se...

Understanding MySQL index pushdown in five minutes

Table of contents What is index pushdown? The pri...

How to start a transaction in MySQL

Preface This article mainly introduces how to sta...

Have you carefully understood Tags How it is defined How to use

Preface : Today I was asked, "Have you carefu...

How to dynamically modify the replication filter in mysql

MySQL dynamically modify replication filters Let ...

Vue component organization structure and component registration details

Table of contents 1. Component Organization 2. Co...

Detailed explanation of Vue slot

1. Function : Allows the parent component to inse...

CSS3 gradient background compatibility issues

When we make a gradient background color, we will...