大佬教程收集整理的这篇文章主要介绍了Linux环境 Mysql新建用户和数据库并授权,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#MysqL -u root -p
2.新增用户
insert into MysqL.user(Host,User,Password) values("localhost","xxx",password("***"));
3.执行该句后,还需要刷新权限表
flush privileges;
4.新建数据库并赋予用户权限
create database dbtest;
全部授权:
允许本地登录
grant all privileges on dbtest. to [email protected] identified by "";
允许任何主机登录
grant all privileges on dbtest. to [email protected]‘%‘ identified by "";
部分授权:
grant select,update on dbtest.* to [email protected] identified by "***";
5.赋予权限,还需要再刷新权限表
flush privileges;
select user,host,password from MysqL.user;
delete from user where user=‘xxx’;
flush privileges;
drop database dbtest;
9.修改密码
update MysqL.user set password=password(‘新密码’) where User=‘xxx‘ and Host=‘localhost‘;flush privileges;
以上是大佬教程为你收集整理的Linux环境 Mysql新建用户和数据库并授权全部内容,希望文章能够帮你解决Linux环境 Mysql新建用户和数据库并授权所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。