[root@localhost data]# mysql -udev_fqr -pDev@fqr2021 --ssl-ca=ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
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 55
Server version: 8.0.22 MySQL Community Server - GPL
Copyright (c) 2000, 2020, 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.
You are enforcing ssl connection via unix socket. Please consider
switching ssl off as it does not make connection via unix socket
any more secure.
mysql>
2)navicate 远程客户端登录
把这三个证书下载下来
配置证书目录,即可远程访问:
二、总结
因为测评的时候不会看 JDBC 里面的配置,所以 JDBC 就不改了,不然要改动的地方非常的多,具体演示的时候可以用提前准备两个账号,到时候用客户端连接即可。
目前两台 mysql 的ssl 用户如下: