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>
相关推荐
消失的旧时光-194342 分钟前
SQL 第一篇:CRUD 实战,从 user 表开始写接口
数据库·sql·mysql
小江的记录本1 小时前
【Kafka核心】Kafka高性能的四大核心支柱:零拷贝、批量发送、页缓存、压缩
java·数据库·分布式·后端·缓存·kafka·rabbitmq
.小小陈.1 小时前
MySQL 核心基础:数据类型与表约束全解析
数据库·mysql
KmSH8umpK1 小时前
Redis分布式锁进阶第十二篇
数据库·redis·分布式
hERS EOUS1 小时前
MySQL 函数
数据库·mysql
gQ85v10Db2 小时前
Redis分布式锁进阶第十六篇:番外高阶避坑篇 + 隐性埋点锁故障深挖 + 疑难杂症终极兜底方案
数据库·redis·分布式
S1998_1997111609•X2 小时前
论恶意注入污染蜜罐进程函数值取仺⺋以集团犯罪获取数据爬虫的轮系依据
网络·数据库·爬虫·网络协议·百度
许彰午2 小时前
# 从OOM到根治的完整过程——导出大数据的应急、根因分析与游标方案
java·大数据·数据库·系统架构
eLIN TECE2 小时前
nacos2.3.0 接入pgsql或其他数据库
数据库
曾几何时`3 小时前
MySQL(七)索引
数据库·mysql