作者:婧儿2502904787 | 来源:互联网 | 2020-11-27 14:40
mysql5.7增加用户的方法:首先登录mysql;然后执行【CREATEUSERtest@localhostIDENTIFIEDBY1234;】语句即可增加用户。
mysql5.7增加用户的方法:首先登录mysql;然后执行【CREATE USER 'test'@'localhost' IDENTIFIED BY '1234';】语句即可增加用户。
增加用户
(推荐教程:mysql视频教程)
举例:创建test用户,密码是1234
MySQL -u root -p
CREATE USER 'test'@'localhost' IDENTIFIED BY '1234'; #本地登录
CREATE USER 'test'@'%' IDENTIFIED BY '1234'; #远程登录
quit
mysql -u test -p #测试是否创建成功
删除用户
mysql -u root -p
Delete FROM mysql.user Where User=”test” and Host=”localhost”;
flush privileges;
drop database testDB;
删除账户及权限:
drop user 用户名@’%’;
drop user 用户名@ localhost;