当前位置:网站首页>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"改为"%",
表示在任何一台电脑上都可以登录。也可以指定某台机器可以远程登录。
边栏推荐
- 使用net core优势/为什么使用
- ESXI挂载移动(机械)硬盘详细教程
- How to install swoole under window
- Redis (II) - redis General Command
- Navicat导入15G数据报错 【2013 - Lost connection to MySQL server during query】 【1153:Got a packet bigger】
- Tkinter window selects PCD file and displays point cloud (open3d)
- How to find the literature of a foreign language journal?
- Shared memory for interprocess communication
- ICML 2022 | explore the best architecture and training method of language model
- Markdown displays pictures side by side
猜你喜欢

2022Android面试必备知识点,一文全面总结
![Stack and queue-p79-10 [2014 unified examination real question]](/img/7f/e5bba2f64bb77e1781076361c32f01.jpg)
Stack and queue-p79-10 [2014 unified examination real question]

一段程序让你明白什么静态内部类,局部内部类,匿名内部类

偏执的非合格公司

Common problems of caching in high concurrency scenarios

Installing redis and windows extension method under win system

请问如何查一篇外文文献的DOI号?

JESD204B时钟网络

Doctoral application | Professor Hong Liang, Academy of natural sciences, Shanghai Jiaotong University, enrolls doctoral students in deep learning

Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
随机推荐
How to install swoole under window
「运维有小邓」符合GDPR的合规要求
Wechat applet hides the progress bar component of the video tag
C interview 24 (pointer) define a double array with 20 elements a
Tkinter window selects PCD file and displays point cloud (open3d)
c面试 加密程序:由键盘输入明文,通过加密程序转换成密文并输出到屏幕上。
使用net core优势/为什么使用
缓存在高并发场景下的常见问题
dolphinscheduler3. X local startup
How to solve sqlstate[hy000]: General error: 1364 field 'xxxxx' doesn't have a default value error
Basic DOS commands
VIM mapping large K
反射(二)
Learning notes | data Xiaobai uses dataease to make a large data screen
ceres-solver和g2o性能比较
Abnova 免疫组化服务解决方案
Abnova 体外转录 mRNA工作流程和加帽方法介绍
String (explanation)
如何解决数据库插入数据显示SQLSTATE[HY000]: General error: 1364 Field ‘xxxxx‘ doesn‘t have a default value错误
LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates