当前位置:网站首页>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"改为"%",
表示在任何一台电脑上都可以登录。也可以指定某台机器可以远程登录。
边栏推荐
- 学术报告系列(六) - Autonomous Driving on the journey to full autonomy
- 缓存在高并发场景下的常见问题
- 【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽
- 屏幕程序用串口无法调试情况
- 2022 Android interview essential knowledge points, a comprehensive summary
- Unable to debug screen program with serial port
- 微信小程序隐藏video标签的进度条组件
- string(讲解)
- 力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
- Postgresql源码(59)分析事务ID分配、溢出判断方法
猜你喜欢

JWT 认证
![Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]](/img/13/096857158c9f977f8677f7cd0f9d4b.png)
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]

【OpenCV】形态学滤波(2):开运算、形态学梯度、顶帽、黑帽

学术报告系列(六) - Autonomous Driving on the journey to full autonomy

直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级

A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are

string(讲解)

偏执的非合格公司

途家、木鸟、美团……民宿暑期战事将起

Jmeter 5.5版本发布说明
随机推荐
雷特智能家居龙海祁:从专业调光到全宅智能,20年专注成就专业
拼多多败诉:“砍价免费拿”侵犯知情权但不构成欺诈,被判赔400元
Postgresql源码(60)事务系统总结
dolphinscheduler3. X local startup
MySQL(十)
Unable to debug screen program with serial port
学习笔记|数据小白使用DataEase制作数据大屏
请问如何查一篇外文文献的DOI号?
大促过后,销量与流量兼具,是否真的高枕无忧?
C语言面试 写一个函数查找两个字符串中的第一个公共字符串
c语言面试写一个函数在字符串N中查找第一次出现子串M的位置。
C language (structure) defines a user structure with the following fields:
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
BindingException 异常(报错)处理
ip地址那点事
Prompt for channel security on the super-v / device defender side when installing vmmare
PostgreSQL database timescaledb function time_ bucket_ Gapfill() error resolution and license replacement
ICML 2022 | 探索语言模型的最佳架构和训练方法
impdp的transform参数的测试
HKUST & MsrA new research: on image to image conversion, fine tuning is all you need