当前位置:网站首页>MySQL传统方案和通过SSH连接哪个好?
MySQL传统方案和通过SSH连接哪个好?
2022-08-09 10:58:00 【InfoQ】
一、背景
二、传统方案
create user "kaka"@"%" identified by 'qwerty123456';grant all privileges on kaka.* to "kaka"@"%" with grant option;或grant all on *.* to "kaka"@"%";flush privileges;
grant update on kaka.* to "kaka"@"%";flush privileges;
Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operationgrant system_user on *.* to 'root';revoke all privileges ,grant option from kaka;或revoke all privileges on kaka.* from kaka;flush privileges;revoke select on kaka.* from kaka;drop from kaka;三、通过SSH隧道连接MySQL数据库
use mysql;update user set host='8.142.40.202' where user = "root";

ssh -fN -L33888:47.93.12.204:3306 [email protected]ssh -o ServerAliveInterval=60 -fN -L33888:47.93.12.204:3306 [email protected]mysql -h 127.0.0.1 -P 33888 -uroot -p
四、本地开发连接
ssh -fN -L3306:47.93.12.204:3306 [email protected]// 127.0.0.1 MySQL服务器地址127.0.0.1 8.142.40.202

五、限制Linux用户登录


usermod -s /sbin/nologin niuniu 

六、扩展一:WITH GRANT OPTION
七、扩展二:Linux用户操作
useradd {username}vipw进去之后删除对应的用户名即可groupdel {username}rm -rf /home/{username}passwd {username}八、总结
边栏推荐
- 彻底理解工厂模式
- 1008 Elevator (20分)
- CSDN的markdown编辑器语法完整大全
- MySQL查询性能优化七种武器之索引潜水
- kubernetes中不可见的OOM
- jmeter BeanShell 后置处理器
- 日期工具类
- 解决1.tensorflow运行使用CPU不使用GPU 2.tensorflow环境下的GPU版本号 3.tensorflow和cuda以及cudnn版本对应问题 4.查看cuda和cudnn版本
- b站up主:空狐公子 --矩阵求导(分母布局)课程笔记
- Missing URI template variable ‘employeeNumber‘ for method parameter of type String
猜你喜欢
随机推荐
情感分析SowNLP词库
tensorflow和numpy对应的版本,报FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecate
C语言统计不同单词数
PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization论文阅读
[Original] Usage of @PrePersist and @PreUpdate in JPA
numpy的ndarray取数操作
图片查看器viewer
CSDN的markdown编辑器语法完整大全
Cluster understanding
中断系统结构及中断控制
golang interface “坑记录“
Solve 1. tensorflow runs using CPU but not GPU 2. GPU version number in tensorflow environment 3. Correspondence between tensorflow and cuda and cudnn versions 4. Check cuda and cudnn versions
golang源代码阅读,sync系列-Map
Input and output of cnn
How tall is the B+ tree of the MySQL index?
focusablejs
1008 Elevator (20分)
GOPROXY 中国代理
无重复字符的最长子串
cesium加载地图









