当前位置:网站首页>MySQL user permissions
MySQL user permissions
2022-07-07 06:51:00 【Q z1997】
1.1 Sign in MYSQL:
@>mysql -u root -p
@> password
1.2 Create user :
Format :grant select on database .* to user name @ Log on to the host identified by ‘ password ’
give an example :
example 1: Add a user test1 The password for abc, Let him log on to any host , And for all databases
Inquire about 、 Insert 、 modify 、 Delete permissions . First of all, it is used to root User connection MySQL, Then type the following command :
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';
perhaps
grant all privileges on . to [email protected] identified by ‘mysql’;
Then refresh the permission settings .
flush privileges;
example 2: If you don't want to root There is a password to operate the database “mydb” The data table in , You can type another command to erase the password .
grant select,insert,update,delete on mydb.* to [email protected] identified by ‘’;
# Be careful : Here "localhost", It means that the user can only log in locally , Can't log in remotely on another machine .
If you want to log in remotely , take "localhost" Change it to "%",
It means that you can log in to any computer . You can also specify that a machine can log in remotely .
边栏推荐
- 多学科融合
- sqlserver多线程查询问题
- Learning notes | data Xiaobai uses dataease to make a large data screen
- Linear algebra (1)
- Config分布式配置中心
- The latest trends of data asset management and data security at home and abroad
- oracle如何备份索引
- A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are
- 偏执的非合格公司
- LM11丨重构K线构建择时交易策略
猜你喜欢
JWT 认证
关于数据库数据转移的问题,求各位解答下
LVS+Keepalived(DR模式)学习笔记
毕业设计游戏商城
如何给目标机器人建模并仿真【数学/控制意义】
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
MOS tube parameters μ A method of Cox
ANR 原理及实践
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
循环肿瘤细胞——Abnova 解决方案来啦
随机推荐
毕业设计游戏商城
sqlserver多线程查询问题
场馆怎么做体育培训?
SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
BindingException 异常(报错)处理
分布式id解决方案
impdp的transform参数的测试
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
unity3d学习笔记
A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are
带你刷(牛客网)C语言百题(第一天)
使用net core优势/为什么使用
【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
C interview 24 (pointer) define a double array with 20 elements a
请问如何查一篇外文文献的DOI号?
This article introduces you to the characteristics, purposes and basic function examples of static routing
当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字
二十岁的我4面拿到字节跳动offer,至今不敢相信
The latest trends of data asset management and data security at home and abroad
Can't you really do it when you are 35 years old?