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>
相关推荐
captain3767 小时前
数据库设计
数据库
XDHCOM1 天前
ORA-32484重复列名错误,ORACLE数据库CYCLE子句故障修复与远程处理方案
数据库·oracle
翻斗包菜1 天前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
呆瑜nuage1 天前
MySQL表约束详解:8大核心约束实战指南
数据库·mysql
liliangcsdn1 天前
Agent Memory智能体记忆系统的示例分析
数据库·人工智能·全文检索
那个失眠的夜1 天前
Mybatis延迟加载策略
xml·java·数据库·maven·mybatis
Rick19931 天前
SQL 执行流程
数据库·sql
M--Y1 天前
Redis常用数据类型
数据结构·数据库·redis
元宝骑士1 天前
FIND_IN_SET使用指南:场景、优缺点与MySQL优化策略
后端·mysql
猿小喵1 天前
MySQL慢查询分析与处理-第二篇
数据库·mysql·性能优化