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. Linux 命令之 crontab

    crontab 简介 crontab 主要用于需要管理周期执行定时任务的场景 crontab 安装 (有些系统默认已经带了 crontab,无需安装的朋友可以直接跳过本节) 安装: yum insta ...

  2. 【IOS开发学习—OC篇】

    一.instancetype和id关键字的区别 1)instancetype表示方法的返回类型和调用方法的对象类型相同. 2)在Object-C引入instancetype之前,初始化方法的返回类型都 ...

  3. salesforce lightning零基础学习(十四) Toast 浅入浅出

    本篇参考: https://developer.salesforce.com/docs/component-library/bundle/force:showToast/specification h ...

  4. php debug_backtrace方法跟踪代码调用

    php debug_backtrace方法跟踪代码调用<pre>function string 当前的函数名,参见: __FUNCTION__.line integer 当前的行号.参见: ...

  5. Eclipse下载安装并运行第一个Hello world(详细)

    Eclipse下载安装并运行第一个Hello world(详细) 1.下载安装和配置JDK JDK详细的安装教程参考:https://www.cnblogs.com/mxxbc/p/11845150. ...

  6. 原来JS是这样的 - 原型链

    上一篇提到属性描述符 [[Get]] 和 [[Put]] 以及提到了访问描述符 [[Prototype]],看它们的特性就会很容易的让人想到经典的面向对象风格体系中对类操作要做的事情,但带一些 int ...

  7. PHP Openssl 生成公钥私钥

    <?php //配置信息 $dn = array( "countryName" => "GB", "stateOrProvinceName ...

  8. redhat、centos7系列破解密码

    redhat或者centos7,破解密码: 1.开机出现引导菜单时按下e键 2.找到linux16行,在其后追加 rd.break 参数 console=tty0 3.启动到特定的模式,由于更改密码需 ...

  9. 删除TFS上的团队项目

    Visual Studio 提供了一个工具 在X:\X\Microsoft Visual Studio X\Common7\IDE   Visual Studio安装路径 下  TFSDeletepr ...

  10. hdu 1233 还是畅通工程 (prim, kruskal)

    还是畅通工程Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submi ...