在 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;
相关文章
相关标签/搜索