(root@node01) > show global variables like 'require_secure_transport';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| require_secure_transport | OFF |
+--------------------------+-------+
1 row in set (0.01 sec)
(root@node01) > create user 'tpcc'@'%' identified by 'abcd.1234';
Query OK, 0 rows affected (0.02 sec)
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01
(tpcc@node02) > \s
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01 --ssl-mode=require
(tpcc@node02) > \s
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01 --ssl-mode=disabled
(tpcc@node02) > \s
SSL: Not in use
(root@node01) > alter user tpcc@'%' require ssl;
Query OK, 0 rows affected (0.00 sec)
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01
(tpcc@node02) > \s
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01 --ssl-mode=require
(tpcc@node02) > \s
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01 --ssl-mode=disabled
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'tpcc'@'node02' (using password: YES)
(root@node01) > alter user tpcc@'%' require X509;
Query OK, 0 rows affected (0.04 sec)
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'tpcc'@'node02' (using password: YES)
[mysql@node02 ~]$ mysql -utpcc -pabcd.1234 -hnode01 --ssl-cert=/home/mysql/client-cert.pem --ssl-key=/home/mysql/client-key.pem
(tpcc@node02) > \s
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
标签:node02,8.0,hnode01,MySQL,pabcd.1234,tpcc,utpcc,mysql,网络连接
From: https://blog.51cto.com/dbprofessional/7243620