Introduction to adding new users to MySql, creating databases for users, and assigning permissions to users

Introduction to adding new users to MySql, creating databases for users, and assigning permissions to users

1. Add a new user

Only allow local IP access

create user 'test'@'localhost' identified by '123456';

Allow external IP access

create user 'test'@'%' identified by '123456';

Refresh Authorization

flush privileges;

2. Create a database for the user

create database test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

3. Assign permissions to users

Grant users all permissions to operate the database through the external IP

grant all privileges on `testdb`.* to 'test'@'%' identified by '123456';

Grant users permission to operate all databases through external IP

grant all privileges on *.* to 'test'@'%' identified by '123456';

Refresh Authorization

flush privileges;

This is the end of this article about how to add new users in MySql, create databases for users, and assign permissions to users. For more information about how to add new users in MySql, create databases for users, and assign permissions to users, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to create a MySQL database and support Chinese characters
  • Mysql anonymous login cannot create a database problem solution
  • mysql create database, add users, user authorization practical method
  • Two ways to create a MySQL database
  • Create database and database table code with MySQL
  • Example of creating a database using PHP
  • Create database php code and write your own BLOG system with PHP
  • PHP Desktop Center (I) Creating a database
  • MySQL and PHP basics and application topics: creating database tables

<<:  Implementation of nested jump of vue routing view router-view

>>:  Vue implements a small countdown function

Recommend

A complete guide to the Docker command line (18 things you have to know)

Preface A Docker image consists of a Dockerfile a...

MySQL 5.5.27 installation graphic tutorial

1. Installation of MYSQL 1. Open the downloaded M...

What magical uses does CSS filter have

background Basic Concepts CSS filter property app...

How to use mysqldump for full and point-in-time backups

Mysqldump is used for logical backup in MySQL. Al...

A detailed introduction to Linux system operation levels

Table of contents 1. Introduction to Linux system...

Use Navicate to connect to MySQL on Alibaba Cloud Server

1. First enter the server's mysql to modify p...

Two implementations of front-end routing from vue-router

Table of contents Mode Parameters HashHistory Has...

Circular progress bar implemented with CSS

Achieve results Implementation Code html <div ...

How to change the password of mysql5.7.20 under linux CentOS 7.4

After MySQL was upgraded to version 5.7, its secu...

Implementation of multiple instances of tomcat on a single machine

1. Introduction First of all, we need to answer a...

Example of implementing login effect with vue ElementUI's from form

Table of contents 1. Build basic styles through E...

Definition and usage of MySQL cursor

Creating a Cursor First, create a data table in M...

Defining the minimum height of the inline element span

The span tag is often used when making HTML web p...