Home > Database > Mysql Tutorial > body text

How to add users in mysql5.7

王林
Release: 2020-10-19 10:58:20
Original
1987 people have browsed it

Mysql5.7 method to add users: first log in to mysql; then execute the [CREATE USER 'test'@'localhost' IDENTIFIED BY '1234';] statement to add users.

How to add users in mysql5.7

Add user

(Recommended tutorial: mysql video tutorial)

Example: Create test User, the password is 1234

MySQL -u root -p 
CREATE USER 'test'@'localhost'  IDENTIFIED BY '1234'; #本地登录 
CREATE USER 'test'@'%'  IDENTIFIED BY '1234'; #远程登录 
quit 
mysql -u test -p #测试是否创建成功
Copy after login

Delete user

mysql -u root -p 
Delete FROM mysql.user Where User=”test” and Host=”localhost”; 
flush privileges; 
drop database testDB;
Copy after login

Delete account and permissions:

drop user 用户名@’%’; 
drop user 用户名@ localhost;
Copy after login

Related recommendations:mysql tutorial

The above is the detailed content of How to add users in mysql5.7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template