mysql -u root -p
password
use mysql
insert into user(host,user,password) values('localhost','hail',password('hail'))
flush privileges
create database haildb
grant all privileges on haildb.* to hail@localhost identified by 'hail'
flush privileges
如果想指定部分权限给用户
grant select,update on haildb.* to hail@localhost identified by 'hail'
flush privileges
删除用户
delete from user where user='hail' and host='localhost'
flush privileges
删除用户数据库
drop database haildb
修改指定用户密码
update user set password=password('new_password') where user='hail' and host='localhost'
flush privileges
显示:“已经禁用删除数据库(DROP DATABASE)语句”请教这是在哪里更改设置的? show grants
贴出以供分析,怀疑用的不是 root@localhost 账号。先select user()
然后show grants for 第一步打印出来的用户和host;grant all privileges on *.* to root@'%' identified by "Passwd"!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)