当前位置:网站首页>MySql用户权限
MySql用户权限
2022-07-07 02:29:00 【Q z1997】
1.1 登录MYSQL:
@>mysql -u root -p
@>密码
1.2 创建用户:
格式:grant select on 数据库.* to 用户名@登录主机 identified by ‘密码’
举例:
例 1:增加一个用户 test1 密码为 abc,让他可以在任何主机上登录,并对所有数据库有
查询、插入、修改、删除的权限。首先用以 root 用户连入 MySQL,然后键入以下命令:
grant select,insert,update,delete on . to [email protected] identified by ‘mysql’;
grant select,insert,update,delete on test_p.* to 'qz1997'@'%' identified by 'qz1997';
或者
grant all privileges on . to [email protected] identified by ‘mysql’;
然后刷新权限设置。
flush privileges;
例 2:如果你不想 root 有密码操作数据库“mydb”里的数据表,可以再打一个命令将密码消掉。
grant select,insert,update,delete on mydb.* to [email protected] identified by ‘’;
#注意:此处的"localhost",是指该用户只能在本地登录,不能在另外一台机器上远程登录。
如果想远程登录的话,将"localhost"改为"%",
表示在任何一台电脑上都可以登录。也可以指定某台机器可以远程登录。
边栏推荐
- Prompt for channel security on the super-v / device defender side when installing vmmare
- Postgresql中procedure支持事务语法(实例&分析)
- 雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业
- Shared memory for interprocess communication
- SVN version management in use replacement release and connection reset
- matlab / ENVI 主成分分析实现及结果分析
- Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
- Matlab / envi principal component analysis implementation and result analysis
- 软件测试到了35岁,真的就干不动了吗?
- 使用net core优势/为什么使用
猜你喜欢
随机推荐
Unity C# 函数笔记
mobx 知识点集合案例(快速入门)
MySQL installation
Which foreign language periodicals are famous in geology?
反射(二)
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
Doctoral application | Professor Hong Liang, Academy of natural sciences, Shanghai Jiaotong University, enrolls doctoral students in deep learning
LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标
Basic DOS commands
【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
Abnova 膜蛋白脂蛋白体技术及类别展示
MySQL(十)
dolphinscheduler3.x本地启动
c面试 加密程序:由键盘输入明文,通过加密程序转换成密文并输出到屏幕上。
FlexRay通信协议概述
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
js装饰器@decorator学习笔记
Symmetric binary tree [tree traversal]
Postgresql中procedure支持事务语法(实例&分析)
Learning notes | data Xiaobai uses dataease to make a large data screen








