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>
相关推荐
摇滚侠6 小时前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
麦聪聊数据8 小时前
数据服务化时代:企业数据能力输出的核心路径
数据库
ApacheSeaTunnel8 小时前
实战演示 | 基于 Apache SeaTunnel 与 Apache DolphinScheduler 实现 MySQL 到 Doris 离线定时增量同步
大数据·mysql·开源·doris·数据集成·seatunnel·数据同步
shushangyun_9 小时前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化
DARLING Zero two♡9 小时前
【MySQL数据库】数据类型与表约束
数据库·mysql
曹牧9 小时前
Oracle EXPLAIN PLAN
数据库·oracle
BD_Marathon9 小时前
SQL学习指南——视图
数据库·sql
活宝小娜10 小时前
mysql详细安装教程
数据库·mysql·adb
贤时间10 小时前
codex 助力oracle ebs 开发
数据库·oracle
秉承初心10 小时前
PostgreSQL 数据性能瓶颈突破实战
数据库·postgresql·oracle