MySQL5.7的搭建以及SSL证书
Centos7 安装MySQL 5.7 (通用二进制包)
1.1 下载软件包
https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
1.2 安装
官方文档:https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html
[root@db01 src]# ll
total 638680
-rw-r--r-- 1 root root 654007697 Aug 28 18:39 mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
[root@db01 src]# tar xf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
[root@db01 src]# ll
total 638680
drwxr-xr-x 9 root root 120 Aug 28 18:45 mysql-5.7.17-linux-glibc2.5-x86_64
-rw-r--r-- 1 root root 654007697 Aug 28 18:39 mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
[root@db01 src]# mv mysql-5.7.17-linux-glibc2.5-x86_64 ../mysql
[root@db01 src]# useradd mysql -s /sbin/nologin -M
[root@db01 src]# mkdir -p /data/mysql
[root@db01 src]# chown -R mysql.mysql /data/mysql/ /usr/local/mysql/
[root@db01 src]# cd ../mysql/
[root@db01 mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
2018-08-28T10:47:23.429133Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-08-28T10:47:26.301233Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-08-28T10:47:26.578937Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-08-28T10:47:26.728515Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c0e8dc08-aaaf-11e8-b620-000c29605a1f.
2018-08-28T10:47:26.773967Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-08-28T10:47:26.785100Z 1 [Note] A temporary password is generated for root@localhost: 2F=6?08hUw5J
[root@db01 mysql]# \cp support-files/mysql.server /etc/init.d/mysqld
[root@db01 data]# cat /etc/my.cnf
[client]
port = 3306
[mysqld]
port = 3306
pid_file = /data/mysql/mysql.pid
datadir = /data/mysql
ssl-ca=/data/mysql/ca.pem
ssl-cert=/data/mysql/server-cert.pem
ssl-key=/data/mysql/server-key.pem
default_storage_engine = InnoDB
max_allowed_packet = 512M
max_connections = 2048
open_files_limit = 65535
skip-name-resolve
lower_case_table_names=1
innodb_buffer_pool_size = 512M
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 0
key_buffer_size = 64M
log-error = /data/mysql/mysql_error.log
log-bin = /data/mysql/mysql-bin
slow_query_log = 1
long_query_time = 5
tmp_table_size = 32M
max_heap_table_size = 32M
query_cache_type = 0
query_cache_size = 0
server-id=1
[root@db01 ~]# echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[root@db01 ~]# source /etc/profile
[root@db01 ~]# mysql -uroot -p'2F=6?08hUw5J'
#生成ssl证书
[root@db01 ~]# mysql_ssl_rsa_setup --basedir=/usr/local/mysql --datadir=/data/mysql
[root@db01 ~]# chown -R mysql.mysql /data/mysql
mysql> show variables like "ssl%";
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> show variables like "ssl%";
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> set password = password("123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show variables like "%ssl%";
+---------------+-----------------------------+
| Variable_name | Value |
+---------------+-----------------------------+
| have_openssl | YES |
| have_ssl | YES |
| ssl_ca | /data/mysql/ca.pem |
| ssl_capath | |
| ssl_cert | /data/mysql/server-cert.pem |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | /data/mysql/server-key.pem |
+---------------+-----------------------------+
9 rows in set (0.00 sec)
MySQL5.7的搭建以及SSL证书的更多相关文章
- 在nginx环境下搭建基于ssl证书的websocket服务转发,wss
1.证书准备 本地调试,可以安装自签名证书,安装方法参考https本地自签名证书添加到信任证书访问 2.修改配置文件 将上面的配置文件拷贝到conf目录,添加或者修改节点如下 # HTTPS serv ...
- openSSL命令、PKI、CA、SSL证书原理
相关学习资料 http://baike.baidu.com/view/7615.htm?fr=aladdin http://www.ibm.com/developerworks/cn/security ...
- [转] Nginx 配置 SSL 证书 + 搭建 HTTPS 网站教程
一.HTTPS 是什么? 根据维基百科的解释: 超文本传输安全协议(缩写:HTTPS,英语:Hypertext Transfer Protocol Secure)是超文本传输协议和SSL/TLS的组合 ...
- Nginx 配置 SSL 证书 + 搭建 HTTPS 网站教程
一.HTTPS 是什么? 根据维基百科的解释: 超文本传输安全协议(缩写:HTTPS,英语:Hypertext Transfer Protocol Secure)是超文本传输协议和SSL/TLS的组合 ...
- 搭建https本地服务器:如何得到被所有客户端认可的ssl证书
https,作为http的加密版,作用还是很大的:能够提升网站搜索权重,让你的网站更安全,而且如果你的网站没有使用https的话,将无法作为移动设备原生应用的api接口.可见掌握为网站启用https的 ...
- 一文教您如何通过 Docker 搭建反向代理 Ngnix,并配置 Https SSL 证书
欢迎关注个人微信公众号: 小哈学Java, 每日推送 Java 领域干货文章,关注附送 100G 海量学习资源哟!! 个人网站: https://www.exception.site/docker/h ...
- https搭建:ubuntu nginx配置 SSL证书
HTTPS 是什么? 根据维基百科的解释: 超文本传输安全协议(缩写:HTTPS,英语:Hypertext Transfer Protocol Secure)是超文本传输协议和SSL/TLS的组合,用 ...
- 免费的SSL证书,免费为微信小程序搭建https
StartSSL 也免费提供了一个证书(纯英文) 申请地址:https://www.startssl.com/Account?r=L1ZhbGlkYXRl 阿里云免费提供的证书 https://com ...
- Linux 搭建Nginx并添加配置 SSL 证书
1. 安装准备 1.1 gcc安装 安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装: [root@nginx ~]# yum -y i ...
随机推荐
- JS中数组和字符串方法的简单整理
一.数组: 数组的基本方法: 1.增:arr.unshift() /push() 前增/后增 2.删:arr.shift() /pop ...
- mysql考试复习
基础创建 字段自动编号auto_increment ( 单词补充:increment 定期的加薪; 增量; 增加) 考点 添加自增 alter table [表名] modify [字段(id)] i ...
- Java REST Client API
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.3/java-rest-high-supported-apis.htm ...
- Nginx的反向调度功能
1.案例实现Nginx反向代理; 2.反向代理的理论知识拓展. 一, 实验Nginx的反向代理功能 使用Nginx实现Web反向代理功能,实现如下功能: 后端Web服务器两台,可以使用httpd实现 ...
- Centos7搭建日志服务器rsyslog+loganalyzer
一.系统环境 Rsyslog Server OS:CentOS 7 Rsyslog Server IP:172.28.194.118 Rsyslog Version: rsyslog-7.4.7-12 ...
- 10 | MySQL为什么有时候会选错索引? 学习记录
<MySQL实战45讲>10 | MySQL为什么有时候会选错索引? 学习记录http://naotu.baidu.com/file/e7c521276650e80fe24584bc9a6 ...
- ps:点阵格式图像
我们所看到的图像,究竟是如何构成的呢?这就需要涉及到图像类型的概念. 电脑中的图像类型分为两大类,一类称为点阵图,一类称为矢量图. 点阵图顾名思义就是由点构成的,如同用马赛克去拼贴图案一样,每个马赛克 ...
- stream benchmark 交叉编译 on psoc
之前有研究过这个,居然忘记了,看来确实是老了,没有盘过来. 如何下载,见 linux下载网页上的文件夹以及删除文件(stream) 出现了好几个问题 1. error while loading sh ...
- MacOS系統Flutter打包apk
一.打包前需要做一些基本设置的确认 1.应用名 2.权限设置 3.applicationId:应用唯一标识符 4.versionCode:版本号 5.versionName:版本名称 6.APP应用图 ...
- bzoj4128 Matrix 矩阵 BSGS
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=4128 题解 想了十分钟没有任何思路. 然后一眼瞥见一句话"数据保证在 \(p\) 内 ...