centos 7 MysSQL 5.7.23 二进制安装
MySQL 5.7.23 二进制安装
CentOS 7 将默认数据库
MySQL
替换成了Mariadb
。
这里会从系统的环境准备开始一步一步安装。
环境准备
系统版本 | 内核版本 | IP地址 |
---|---|---|
Centos 7.5 | 4.18.9-1.el7.elrepo.x86_64 | 10.0.0.3 |
备注 该系统采用MINI
最小化安装,安装之后对系统进行了最基础的优化操作,操作过程点击这里
删除系统自带的依赖包
[root@node soft]# rpm -qa | egrep 'mysql|mariadb'
mariadb-libs-5.5.56-2.el7.x86_64
[root@node soft]# rpm -qa | egrep 'mysql|mariadb' | xargs rpm -e --nodeps
[root@node soft]# rpm -qa | egrep 'mysql|mariadb'
[root@node soft]#
创建MySQL运行用户
[root@node soft]# useradd -s /sbin/nologin -M mysql
[root@node soft]# grep mysql /etc/passwd
mysql:x:1000:1000::/home/mysql:/sbin/nologin
下载 MySQL
可以在mirrors.163.com
的163源下载
下载地址
如果上面的下载地址失效了,则可以使用百度网盘:百度云盘
提取码:4qh6
[root@node soft]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
[root@node soft]# ls
mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
# 解压
[root@node soft]# tar xf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
[root@node soft]# ls
mysql-5.7.23-linux-glibc2.12-x86_64 mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
配置环境变量
[root@node soft]# mv mysql-5.7.23-linux-glibc2.12-x86_64 /opt/mysql-5.7.23
[root@node soft]# cd /opt/
[root@node opt]# ls
mysql-5.7.23 soft
[root@node opt]# chown -R mysql.mysql mysql-5.7.23
[root@node opt]# ll
total 0
drwxr-xr-x 9 mysql mysql 129 Sep 30 10:33 mysql-5.7.23
drwxr-xr-x 2 root root 56 Sep 30 10:34 soft
[root@node opt]# echo 'export PATH=$PATH:/opt/mysql-5.7.23/bin' >> /etc/profile
[root@node opt]# tail -1 /etc/profile
export PATH=$PATH:/opt/mysql-5.7.23/bin
[root@node opt]# source /etc/profile
[root@node opt]# mysql -V
mysql Ver 14.14 Distrib 5.7.23, for linux-glibc2.12 (x86_64) using EditLine wrapper
配置MySQL启动脚本并设置开机自启
二进制解压后的目录中,包括了MySQL的启动关闭脚本,可以使用,也可以自己写
systemctl
管理脚本
[root@node opt]# cd mysql-5.7.23/
[root@node mysql-5.7.23]# pwd
/opt/mysql-5.7.23
[root@node mysql-5.7.23]# ls
bin COPYING docs include lib man README share support-files
[root@node mysql-5.7.23]# cp support-files/mysql.server /etc/init.d/mysqld
[root@node mysql-5.7.23]# chmod +x /etc/init.d/mysqld
[root@node mysql-5.7.23]# sed -i 's#/usr/local/mysql#/opt/mysql-5.7.23#g' /etc/init.d/mysqld
[root@node mysql-5.7.23]# chkconfig --add mysqld
[root@node mysql-5.7.23]# chkconfig mysqld on
[root@node mysql-5.7.23]# chkconfig | grep mysqld
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
初始化 MySQL
[root@node mysql-5.7.23]# pwd
/opt/mysql-5.7.23
[root@node mysql-5.7.23]# mkdir data
[root@node mysql-5.7.23]# mysqld --initialize --user=mysql --basedir=/opt/mysql-5.7.23 --datadir=/opt/mysql-5.7.23/data
配置文件
[root@node mysql-5.7.23]# cat my.cnf
[client]
socket = /tmp/mysql.sock
port=3306
[mysql]
default-character-set=utf8
[mysqld]
basedir=/opt/mysql-5.7.23
datadir=/opt/mysql-5.7.23/data
port=3306
pid-file=/opt/mysql-5.7.23/mysqld.pid
skip-name-resolve
socket = /tmp/mysql.sock
character-set-server=utf8
default-storage-engine=INNODB
explicit_defaults_for_timestamp = true
server-id=1
max_connections=2000
query_cache_size=0
table_open_cache=2000
tmp_table_size=246M
thread_cache_size=300
thread_stack = 192k
key_buffer_size=512M
read_buffer_size=4M
read_rnd_buffer_size=32M
innodb_data_home_dir = /opt/mysql-5.7.23/data
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=16M
innodb_buffer_pool_size=256M
innodb_log_file_size=128M
innodb_thread_concurrency=128
innodb_autoextend_increment=1000
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log = 80
flush_time = 0
join_buffer_size = 128M
max_allowed_packet = 1024M
max_connect_errors = 2000
open_files_limit = 4161
query_cache_type = 0
sort_buffer_size = 32M
table_definition_cache = 1400
binlog_row_event_max_size = 8K
sync_master_info = 10000
sync_relay_log = 10000
sync_relay_log_info = 10000
bulk_insert_buffer_size = 64M
interactive_timeout = 120
wait_timeout = 120
log-bin-trust-function-creators=1
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error = /opt/mysql-5.7.23/error.log
pid-file = /opt/mysql-5.7.23/mysqld.pid
启动
[root@node mysql-5.7.23]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!
[root@node mysql-5.7.23]# ps aux|grep mysql
root 8356 1.2 0.1 113320 3128 pts/0 S 10:35 0:00 /bin/sh /opt/mysql-5.7.23/bin/mysqld_safe --datadir=/opt/mysql-5.7.23/data --pid-file=/opt/mysql-5.7.23/mysqld.pid
mysql 9102 5.2 14.4 1776888 291536 pts/0 Sl 10:35 0:00 /opt/mysql-5.7.23/bin/mysqld --basedir=/opt/mysql-5.7.23 --datadir=/opt/mysql-5.7.23/data --plugin-dir=/opt/mysql-5.7.23/lib/plugin --user=mysql --log-error=/opt/mysql-5.7.23/error.log --open-files-limit=4161 --pid-file=/opt/mysql-5.7.23/mysqld.pid --socket=/tmp/mysql.sock --port=3306
root 9132 0.0 0.1 112716 2188 pts/0 S+ 10:35 0:00 grep --color=auto mysql
[root@node mysql-5.7.23]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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>
查看日志
[root@node mysql-5.7.23]# cat error.log
2018-10-08T02:35:19.046722Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-10-08T02:35:19.046763Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2018-10-08T02:35:19.046778Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-10-08T02:35:19.046792Z 0 [Note] /opt/mysql-5.7.23/bin/mysqld (mysqld 5.7.23) starting as process 9102 ...
2018-10-08T02:35:19.064739Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-10-08T02:35:19.064772Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-10-08T02:35:19.064775Z 0 [Note] InnoDB: Uses event mutexes
2018-10-08T02:35:19.064777Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2018-10-08T02:35:19.064780Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-10-08T02:35:19.064782Z 0 [Note] InnoDB: Using Linux native AIO
2018-10-08T02:35:19.064794Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2018-10-08T02:35:19.065357Z 0 [Note] InnoDB: Number of pools: 1
2018-10-08T02:35:19.065416Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-10-08T02:35:19.066693Z 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2018-10-08T02:35:19.077288Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-10-08T02:35:19.079399Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-10-08T02:35:19.090732Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-10-08T02:35:19.096688Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-10-08T02:35:19.096750Z 0 [Note] InnoDB: Setting file '/opt/mysql-5.7.23/data/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-10-08T02:35:19.107248Z 0 [Note] InnoDB: File '/opt/mysql-5.7.23/data/ibtmp1' size is now 12 MB.
2018-10-08T02:35:19.107796Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-10-08T02:35:19.107804Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-10-08T02:35:19.108372Z 0 [Note] InnoDB: 5.7.23 started; log sequence number 2589252
2018-10-08T02:35:19.108585Z 0 [Note] InnoDB: Loading buffer pool(s) from /opt/mysql-5.7.23/data/ib_buffer_pool
2018-10-08T02:35:19.109989Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181008 10:35:19
2018-10-08T02:35:19.110083Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-10-08T02:35:19.112065Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-10-08T02:35:19.112078Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-10-08T02:35:19.112110Z 0 [Note] IPv6 is available.
2018-10-08T02:35:19.112115Z 0 [Note] - '::' resolves to '::';
2018-10-08T02:35:19.112145Z 0 [Note] Server socket created on IP: '::'.
2018-10-08T02:35:19.117779Z 0 [Note] /opt/mysql-5.7.23/bin/mysqld: ready for connections.
Version: '5.7.23' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
centos 7 MysSQL 5.7.23 二进制安装的更多相关文章
- centos 7 MysSQL 5.6.39 二进制安装
MySQL 5.6.39 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...
- centos 7 MysSQL 5.7.23 源码安装
MySQL 5.7.23 源码安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos 7 ...
- CentOS 6.2 二进制安装apache2.4.3出现configure: error: APR-util not found. Please read the documentation的解决方
CentOS 6.2 二进制安装apache2.4.3出现configure: error: APR-util not found. Please read the documentation的解决方 ...
- centos 7.3二进制安装mariadb10.2.8完美步骤
(1)在centos7系统上,yum info mariadb可以找到提供mariadb包的官方网站,在到官方网站下载最新的mariadb包,然后rz到linux系统上去 (2)准备用户 1.user ...
- CentOS 6.5下二进制安装 MySQL 5.6
CentOS 6.5 二进制安装MySQL 5.6 1:查看系统版本 [root@10-4-5-9 mysql]# cat /etc/redhat-release CentOS release 6.5 ...
- centos 7 MysSQL 5.6.39 源码安装
MySQL 5.6.39 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...
- Centos 二进制安装node.js
一.登录node的官网查看最新的稳定版,以及需要下载的Linux版本,你可以有多种Linux安装方式(源码安装,二进制安装等). 二.Node安装及配置 1.创建安装目录:创建目录node.js [r ...
- Centos7 二进制安装 Kubernetes 1.13
目录 1.目录 1.1.什么是 Kubernetes? 1.2.Kubernetes 有哪些优势? 2.环境准备 2.1.网络配置 2.2.更改 HOSTNAME 2.3.配置ssh免密码登录登录 2 ...
- [sql]mysql5.6cmake安装/mysql5.7二进制安装
centos7上cmake编译安装mysql-5.6.36.tar.gz 系统环境 - 环境(安装前规划好主机名,mysql编译过程会用) [root@n1 mysql-5.6.36]# cat /e ...
随机推荐
- Unity5-ABSystem(三):AssetBundle加载
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/lodypig/article/detai ...
- python str的一些操作及处理
一.str的定义:Python中凡是用引号引起来的数据可以称为字符串类型,组成字符串的每个元素称之为字符,将这些字符一个一个连接起来,然后在用引号起来就是字符串. 二.str的简单操作方法: conu ...
- Everything可能泄漏大量电脑敏感资料
一款好用的文件搜索工具Everything被批露出现重大问题: Everything可以打开http服务,在没有加密的情况下任何外网电脑都可以连接的. 因此,Everything可能泄漏大量电脑敏感资 ...
- [考试反思]0907NOIP模拟测试39:角落
题比较简单,但是做的非常烂. T1是个愚蠢的找规律组合数快速幂,数组开小了(看错数据范围) T2题目保证联通没看见,hack掉了正解. T3也挺蠢的,但是打乱了,思路不是很清晰导致丢了50分. 只能说 ...
- Tornado 异步socketTCP通信
Tornado 有 TCPClient 和 TCPServer 两个类,可用于实现 tcp 的客户端和服务端.事实上,这两个类都是对iostream的简单包装. 真正重要的是 iostream ios ...
- maven安装与在eclipse中配置
需要准备 eclipse maven压缩包 : http://maven.apache.org/download.cgi 1 解压maven压缩包 2 在系统变量中新建变量MAVEN_HOME,值为 ...
- DNS服务反向解析及过程中一些小问题解决
在此需要了解一下,反向解析的作用是根据IP地址查找到对应的主机名(域名),在区域文件(named.rfc1912.zones)中默认已存在一些注释内容与区域信息,可不需要删除上面实验及默认区域信息,直 ...
- 前端Leader你应该知道的NPM包管理机制
npm install 命令 首先总结下npm 安装一个模块包的常用命令. /* 模块依赖会写入 dependencies 节点 */ npm install moduleName npm insta ...
- 【algo&ds】【吐血整理】4.树和二叉树、完全二叉树、满二叉树、二叉查找树、平衡二叉树、堆、哈夫曼树、B树、字典树、红黑树、跳表、散列表
本博客内容耗时4天整理,如果需要转载,请注明出处,谢谢. 1.树 1.1树的定义 在计算机科学中,树(英语:tree)是一种抽象数据类型(ADT)或是实作这种抽象数据类型的数据结构,用来模拟具有树状结 ...
- nowcoder 鹏
鹏 时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 化而为鸟,其名为鹏.鹏之背,不知其 ...