[root@db143 client]# mysql -h 192.168.142.145 --ssl-cert=/data/client/client-cert.pem --ssl-key=/data/client/client-key.pem -uuser_w -p‘user_w_pwd‘

mysql: [Warning] Using a password onthe command line interface can be insecure.

Welcometo the MySQL monitor. Commands end with ; or\g.

Your MySQL connection idis 16Server version:8.0.18 MySQL Community Server -GPL

Copyright (c)2000, 2019, Oracle and/or its affiliates. Allrights reserved.

Oracleis a registered trademark of Oracle Corporation and/orits

affiliates. Other names may be trademarksoftheir respective

owners.

Type‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the currentinput statement.

mysql>\s;--------------

mysql Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server -GPL)

Connection id:16

Current database:Current user: user_w@192.168.142.143SSL: Cipherin use isTLS_AES_256_GCM_SHA384Currentpager: stdout

Using outfile:‘‘Using delimiter: ;

Server version:8.0.18 MySQL Community Server -GPL

Protocol version:10Connection:192.168.142.145 via TCP/IP

Server characterset: utf8mb4

Db characterset: utf8mb4

Client characterset: utf8mb4

Conn. characterset: utf8mb4

TCP port:3306Uptime:22 min 7sec

Threads:3 Questions: 35 Slow queries: 0 Opens: 1162 Flush tables: 3 Open tables: 48 Queries per second avg: 0.026

--------------

ERROR:

No query specified

mysql> exit

[root@db143 client]# mysql -h 192.168.142.145 -uuser_w -p‘user_w_pwd‘ mysql: [Warning] Using a password on the command line interface can be insecure.

ERROR 1045 (28000): Access denied for user ‘user_w‘@‘192.168.142.143‘ (using password: YES)

[root@db143 client]#

# 如果是从库的话,需要使用自己的pem

[root@db143 data]# mysql -h 192.168.142.143 --ssl-cert=/data/mysql/mysql_3306/data/client-cert.pem --ssl-key=/data/mysql/mysql_3306/data/client-key.pem -uuser_w -p‘user_w_pwd‘

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 23

Server version: 8.0.18 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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> exit

Bye

[root@db143 data]#

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐