在 mysql 数据库中创建用户和数据库以及修改用户密码

1.创建用户
insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values("localhost","hello",password("Test"),"","","");
刷新权限
flush privileges;
创建数据库
create database test;
给数据库赋予权限
grant all privileges on test.* to hello @localhost identified by 'Test';
flush privileges;
2.删除用户
delete from user whrer User="hello" and Host="localhost";
删除数据库
drop database test;

3.修改指定用户的密码
mysql -u root -p
密码

update mysql.user set password('新密码') where User="hello" and Host="localhost";
flush privileges;

你可能感兴趣的:(数据库,修改用户密码,mysql创建用户)