TDSQL 免密码登录

需求

os用户免密登录tdsql

解决方案

使用mysql自带的 mysql_config_editor 工具

提示:使用这个工具,登录密码不能包含#字符。

操作步骤

  • 建os账号,切换到新账号
bash 复制代码
[root@tdsql1 ~]# useradd jdbc_user 
[root@tdsql1 ~]# su - jdbc_user 
[jdbc_user@tdsql1 ~]$
  • 使用 mysql_config_editor 创建混淆的登录配置文件
bash 复制代码
[jdbc_user@tdsql1 ~]$ cd /data/tdsql_run/4001/mysql-server-8.0.24/bin/ 
[jdbc_user@tdsql1 bin]$ ./mysql_config_editor set --login-path=dbjdbc --user=jdbc --host=172.0.0.1 --port=15003 --password 
Enter password: 

[jdbc_user@tdsql1 bin]$ ll ~/.mylogin.cnf 
-rw------- 1 jdbc_user jdbc_user 156 Nov 18 14:59 /home/jdbc_user/.mylogin.cnf
  • 使用 mysql 测试登录
bash 复制代码
[jdbc_user@tdsql1 bin]$ ./mysql --login-path=dbjdbc 
Welcome to the TXSQL monitor. Commands end with ; or \g. 
Your TXSQL connection id is 4921005 
Server version: 8.0.33-v24-txsql-22.6.0-20240417 Source distribution 

Copyright (c) 2000, 2021, Oracle and/or its affiliates. 

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

txsql>
相关推荐
张洛闻Eren2 小时前
MySQL 维护稳定系统【MySQL第二课】
linux·数据库·mysql·云原生
布莱克6053 小时前
理解索引:从概念到实践
数据库·mysql
g10565591396 小时前
LAMP博客平台Wordpress实战
android·mysql·nginx·php
我不是疯子是傻子6 小时前
Qt CAN通信周期发送抖动?实测定时器精度校准与时间戳补偿方案
开发语言·数据库·qt
这个DBA有点耶7 小时前
数据库迁移怎么做到“零翻车“:金仓 KDMS/KDTS/KFS 工具链实测
数据库·架构·dba
2501_937860947 小时前
MySQL联合查询(多表查询)
数据库·mysql
名字还没想好☜8 小时前
Next.js 用 Server Components 直连数据库:去掉 API 层的边界,和三条别踩的安全红线
前端·javascript·数据库·安全·react·next.js
迷迭香yy8 小时前
行业板块轮动因子实战从板块资金到因子建模的本地化Python全流程
数据库·人工智能·python
SelectDB9 小时前
抖音集团 实时数据仓库:Apache Doris / SelectDB 的技术能力与实践
数据库
SelectDB9 小时前
网易 日志与时序数据分析:Apache Doris / SelectDB 的技术能力与实践
数据库