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

MySQL database implements MMM high availability cluster architecture

concept MMM (Master-Master replication manager fo...

Analysis of the principles of docker containers

Table of contents 01 What is the essence of a con...

Comparing Node.js and Deno

Table of contents Preface What is Deno? Compariso...

Solution to the failure of docker windows10 shared directory mounting

cause When executing the docker script, an error ...

How to prevent computer slowdown when WIN10 has multiple databases installed

Enable the service when you need it, and disable ...

my.cnf (my.ini) important parameter optimization configuration instructions

MyISAM storage engine The MyISAM storage engine i...

MySQL UNION operator basic knowledge points

MySQL UNION Operator This tutorial introduces the...

How to write HTML head in mobile device web development

Copy code The code is as follows: <head> &l...

How to communicate between WIN10 system and Docker internal container IP

1. After installing the Windows version of Docker...

Example of implementing todo application with Vue

background First of all, I would like to state th...

MySQL stored procedure method example of returning multiple values

This article uses an example to describe how to r...