[摘要]MySQL 5.7--------SSL连接最佳实战1. 背景 * 在生产环境下,安全总是无法忽视的问题,数据库安全则是重中之重,因为所有的数据都存放在数据库中 * 当使用非加密方式连接My...
MySQL 5.7--------SSL连接最佳实战1. 背景
* 在生产环境下,安全总是无法忽视的问题,数据库安全则是重中之重,因为所有的数据都存放在数据库中
* 当使用非加密方式连接MySQL数据库时,在网络中传输的所有信息都是明文的,可以被网络中所有人截取,敏感信息可能被泄露。在传送敏感信息(如密码)时,可以采用SSL连接的方式。
* 版本小于5.7.6时按照 MySQL 5.6 SSL配置的方式进行。
2. MySQL 连接方式
* socket连接
* TCP非SSL连接
* SSL安全连接
* SSL + 密码连接 [version > MySQL 5.7.5]
* SSL + 密码 + 密钥连接
3. SSL 简介
* SSL指的是SSL/TLS,其是一种为了在计算机网络进行安全通信的加密协议。假设用户的传输不是通过SSL的方式,那么其在网络中以明文的方式进行传输,而这给别有用心的人带来了可乘之机。所以,现在很多网站其实默认已经开启了SSL功能,比如Facebook、Twtter、YouTube、淘宝等。

4. 环境 [ 关闭SeLinux ]
* system 环境
[root@MySQL ~]
CentOS release 6.9 (Final)
[root@MySQL ~]
2.6.32-696.3.2.el6.x86_64
[root@MySQL ~]
Disabled
* MySQL 环境 [ MySQL 5.7安装前面篇章已做详细介绍 ]
have_openssl 与 have_ssl 值都为DISABLED表示ssl未开启
[root@MySQL ~]
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 6
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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>
select
version();
+-----------+
关键词:SSL连接的案例图文详细教程