我是靠谱客的博主 甜蜜酸奶,这篇文章主要介绍mysql指定怎样创建dba_MySQL创建一个用户,指定一个数据库 授权,现在分享给大家,希望可以做个参考。

Mysql 创建一个用户 hail,密码 hail,指定一个数据库 haildb 给 hail

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;

1.远程登录mysql

mysql -h ip

最后

以上就是甜蜜酸奶最近收集整理的关于mysql指定怎样创建dba_MySQL创建一个用户,指定一个数据库 授权的全部内容,更多相关mysql指定怎样创建dba_MySQL创建一个用户,指定一个数据库内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(119)

评论列表共有 0 条评论

立即
投稿
返回
顶部