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.
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 #测试是否创建成功
Delete user
mysql -u root -p Delete FROM mysql.user Where User=”test” and Host=”localhost”; flush privileges; drop database testDB;
Delete account and permissions:
drop user 用户名@’%’; drop user 用户名@ localhost;
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!