[tidb@monitor ~]$ mysql_config_editor set --login-path=tidb --user=root --password --host=192.168.1.181 --port=4000 Enter password: 也可以简写: [root@mysql mysql]# mysql_config_editor set -G tidb -u root -p -h 192.168.1.181 -P 4000
免输密码登录: [tidb@monitor ~]$ mysql --login-path=tidb Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 211812362 Server version: 8.0.11-TiDB-v8.3.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
Copyright (c) 2000, 2024, 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.
mysql>
2.查看配置
1 2 3 4 5 6
[tidb@monitor ~]$ mysql_config_editor print --all [tidb] user = "root" password = ***** host = "192.168.1.181" port = 4000