MySQL 5.6.39 二进制安装

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源下载,点击我下载

如果上面的下载地址失效了,则可以使用百度网盘:链接:https://pan.baidu.com/s/1Sln84TrPQhA2jyt_t51X1Q

提取码:oyxj

[root@node ~]# cd /opt/soft/
[root@node soft]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
[root@node soft]# ls
mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
# 解压
[root@node soft]# tar xf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
[root@node soft]# ls
mysql-5.6.39-linux-glibc2.12-x86_64 mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

配置环境变量

[root@node soft]# mv mysql-5.6.39-linux-glibc2.12-x86_64 /opt/mysql
[root@node soft]# chown -R mysql.mysql /opt/mysql
[root@node soft]# cd /opt/
[root@node opt]# ls
mysql
[root@node opt]# echo 'export PATH=$PATH:/opt/mysql/bin' >> /etc/profile
[root@node opt]# tail -1 /etc/profile
export PATH=$PATH:/opt/mysql/bin
[root@node opt]# source /etc/profile
[root@node opt]# mysql -V
mysql Ver 14.14 Distrib 5.6.39, for linux-glibc2.12 (x86_64) using EditLine wrapper

配置MySQL启动脚本并设置开机自启

二进制解压后的目录中,包括了MySQL的启动关闭脚本,可以使用,也可以自己写systemctl管理脚本

[root@node opt]# cd mysql/
[root@node mysql]# pwd
/opt/mysql
[root@node mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@node mysql]# chmod +x /etc/init.d/mysqld
[root@node mysql]# sed -i 's#/usr/local#/opt#g' /etc/init.d/mysqld
[root@node mysql]# chkconfig --add mysqld
[root@node mysql]# chkconfig mysqld on
[root@node mysql]# chkconfig | grep mysql 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

配置文件

[root@node mysql]# pwd
/opt/mysql
# 配置文件
[root@node mysql]# cat my.cnf
[client]
socket = /tmp/mysql.sock
port=3306 [mysql]
default-character-set=utf8 [mysqld]
basedir=/opt/mysql
datadir=/opt/mysql/data
port=3306
pid-file=/opt/mysql/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/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/error.log
pid-file=/opt/mysql/mysqld.pid
[root@node mysql]# touch /opt/mysql/error.log
[root@node mysql]# chown -R mysql.mysql /opt/mysql/

MySQL 初始化

[root@node mysql]# pwd
/opt/mysql
[root@node mysql]# ./scripts/mysql_install_db --basedir=/opt/mysql --datadir=/opt/mysql/data --user=mysql
# 下面的提示出现两个 OK 表示初始化成功。

启动 测试

[root@node mysql]# /etc/init.d/mysqld  start
Starting MySQL.. SUCCESS!
[root@node mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.39 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]# cat error.log
2018-09-29 17:27:51 19821 [Note] Plugin 'FEDERATED' is disabled.
2018-09-29 17:27:51 19821 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-09-29 17:27:51 19821 [Note] InnoDB: The InnoDB memory heap is disabled
2018-09-29 17:27:51 19821 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-09-29 17:27:51 19821 [Note] InnoDB: Memory barrier is not used
2018-09-29 17:27:51 19821 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-09-29 17:27:51 19821 [Note] InnoDB: Using Linux native AIO
2018-09-29 17:27:51 19821 [Note] InnoDB: Using CPU crc32 instructions
2018-09-29 17:27:51 19821 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2018-09-29 17:27:51 19821 [Note] InnoDB: Completed initialization of buffer pool
2018-09-29 17:27:51 19821 [Note] InnoDB: Highest supported file format is Barracuda.
2018-09-29 17:27:51 19821 [Note] InnoDB: 128 rollback segment(s) are active.
2018-09-29 17:27:51 19821 [Note] InnoDB: Waiting for purge to start
2018-09-29 17:27:51 19821 [Note] InnoDB: 5.6.39 started; log sequence number 1626686
2018-09-29 17:27:51 19821 [Note] Server hostname (bind-address): '*'; port: 3306
2018-09-29 17:27:51 19821 [Note] IPv6 is available.
2018-09-29 17:27:51 19821 [Note] - '::' resolves to '::';
2018-09-29 17:27:51 19821 [Note] Server socket created on IP: '::'.
2018-09-29 17:27:51 19821 [Note] /opt/mysql/bin/mysqld: ready for connections.
Version: '5.6.39' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)

至此 使用二进制包安装mysql完成

centos 7 MysSQL 5.6.39 二进制安装的更多相关文章

  1. centos 7 MysSQL 5.7.23 二进制安装

    MySQL 5.7.23 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...

  2. centos 7 MysSQL 5.6.39 源码安装

    MySQL 5.6.39 二进制安装 CentOS 7 将默认数据库MySQL替换成了Mariadb. 这里会从系统的环境准备开始一步一步安装. 环境准备 系统版本 内核版本 IP地址 Centos ...

  3. 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的解决方 ...

  4. centos 7.3二进制安装mariadb10.2.8完美步骤

    (1)在centos7系统上,yum info mariadb可以找到提供mariadb包的官方网站,在到官方网站下载最新的mariadb包,然后rz到linux系统上去 (2)准备用户 1.user ...

  5. 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 ...

  6. Centos 二进制安装node.js

    一.登录node的官网查看最新的稳定版,以及需要下载的Linux版本,你可以有多种Linux安装方式(源码安装,二进制安装等). 二.Node安装及配置 1.创建安装目录:创建目录node.js [r ...

  7. Centos7 二进制安装 Kubernetes 1.13

    目录 1.目录 1.1.什么是 Kubernetes? 1.2.Kubernetes 有哪些优势? 2.环境准备 2.1.网络配置 2.2.更改 HOSTNAME 2.3.配置ssh免密码登录登录 2 ...

  8. (0.2.3)Mysql安装——二进制安装

    Linux平台下二进制方式安装卸载mysql 本章节:二进制安装mysql 目录: 1.基于Linux平台的Mysql项目场景介绍 2.mysql数据库运行环境准备-最优配置 3.如何下载mysql数 ...

  9. Mysql的二进制安装和基础入门操作

    前言:Mysql数据库,知识非常的多,要想学精学通这块知识,估计也要花费和学linux一样的精力和时间.小编也是只会些毛皮,给大家分享一下~ 一.MySQL安装 (1)安装方式: 1 .程序包yum安 ...

随机推荐

  1. HTML5+CSS:02用户注册表单

            新的学期已开始接近两个月了,还记得是在国庆节那几天申请的博客账号,可过了一个月都还没开始写博客,(>_<)有点小偷懒了,不过,学习还是不能落下的,今写一个有点实践运用的关于 ...

  2. 键盘常见ascii码值

    回车事件最常见,码值13 ESC键: VK_ESCAPE (27) 回车键: VK_RETURN (13) TAB键: VK_TAB (9) Caps Lock键: VK_CAPITAL (20) S ...

  3. Java后端开发工作 - 写接口

    我在公司的工作内容是,对于一个BS应用,负责服务器端开发工作,Java语言.与前端开发人员合作,最终提供给前端RESTFUL接口,保证页面正常响应. 经验之谈 一个接口可以理解为一个业务逻辑,一个业务 ...

  4. [2018-08-03] python开发个人资源共享网--第一天

    项目需求-环境搭建 python版本:python 3.6.2 开发工具:PyCharm 数据库:MySql5.7.24 数据库管理工具:Navicat 环境搭建完毕 ---------------- ...

  5. [考试反思]0916csp-s模拟测试44:可笑

    出现了有史以来第一个3首杀AK啊...然而跟我没有丝毫关系 (曾经还是有一次考试差点就有那么一点关系的...) 然而反正我考得很水就是了.不是很垃圾,而是很水. 这套题是真的水... T1不会证复杂度 ...

  6. Python实现王者荣耀小助手(二)

    接下来我们获取英雄和武器信息,详细代码KingGlory.py如下(代码中有详细注解): # -*- coding: utf-8 -*- #!/usr/bin/env python # @Time : ...

  7. linux 自启动 | 三种方式自启动

    linux 实现自启动有多种方式,通过Linux 底层启动原理介绍,便可以理解以下几种方式 这里简单介绍一下这几种方式 一.自定义开机程序   /etc/rc.d/rc.local  1.vim  / ...

  8. spring 是如何注入对象的和bean 创建过程分析

    文章目录: beanFactory 及 bean 生命周期起步 BeanFactory refresh 全过程 BeanFactoryPostProcessor 和 BeanPostProcessor ...

  9. 一分钟带你了解下Spring Security!

    一.什么是Spring Security? Spring Security是一个功能强大且高度可定制的身份验证和访问控制框架,它是用于保护基于Spring的应用程序的实际标准. Spring Secu ...

  10. 用IDEA导入Eclipse的JavaWEB项目

    1.File----Open 2.选择项目路径 点击OK,这时候会弹出一个窗口,让你选择本窗口打开项目还是新建一个窗口,这个随意. 3.添加WEB框架 4.添加各种自己需要的jar包 5.添加Tomc ...