mysql8.0 关闭ssl连接_mysql8.0 使用 x509设置加密连接

本文演示了如何使用SSL证书连接到MySQL 8.0服务器,首先通过指定SSL选项成功连接,然后展示了在不使用SSL时遇到的访问权限问题。
摘要由CSDN通过智能技术生成

[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]#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值