当前位置:网站首页>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 operation
grant 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}
八、总结
边栏推荐
- AQS同步组件-ForkJoin、BlockingQueue阻塞队列解析和用例
- 详细的np.matmul / np.dot / np.multiply / tf.matmul / tf.multiply / *
- 【 original 】 VMware Workstation implementation Openwrt soft routing, the ESXI, content is very detailed!
- C语言统计不同单词数
- autogluon安装,使用指南,代码
- 基于STM32设计的环境检测设备
- 真香!肝完Alibaba这份面试通关宝典,我成功拿下今年第15个Offer
- 备战金三银四:如何成功拿到阿里offer(经历+面试题+如何准备)
- 为什么组合优先于继承
- 1007 Maximum Subsequence Sum (25分)
猜你喜欢
【VIBE: Video Inference for Human Body Pose and Shape Estimation】论文阅读
jmeter BeanShell 后置处理器
电磁场与电磁波-场论基础
MNIST机器学习入门
shap库源码和代码实现
Getting Started with MNIST Machine Learning
Multi-merchant mall system function disassembly 26 lectures - platform-side distribution settings
Cluster understanding
Shell script combat (2nd edition) / People's Posts and Telecommunications Press Script 1 Find programs in the PATH
图片查看器viewer
随机推荐
MySQL查询性能优化七种武器之索引潜水
ThreadLocal及其内存泄露分析
CentOS6.5 32bit安装Oracle、ArcSde、Apache等配置说明
【 original 】 VMware Workstation implementation Openwrt soft routing, the ESXI, content is very detailed!
numpy的ndarray取数操作
jmeter BeanShell 后置处理器
性能测试(04)-表达式和业务关联-JDBC关联
激光条纹中心提取——灰度重心法
uni-app 自带的picker封装一个日期-时间选择器
Qt读写.ini配置文件
绝了,这套RESTful API接口设计总结
日期工具类
中断系统结构及中断控制
[Original] Usage of @PrePersist and @PreUpdate in JPA
Shell script combat (2nd edition) / People's Posts and Telecommunications Press Script 2 Validate input: letters and numbers only
activemq message persistence
数据存储:对dataframe类,使用to_csv()将中文数据写入csv文件
pip常见命令和更改源文件
OpenSSF的开源软件风险评估工具:Scorecards
torch.stack()的官方解释,详解以及例子