MySQL 5.7.18 在centos下安装记录

原创 2017年07月22日 19:02:36

一个朋友找我如何在linux下安装mysql5.7.18,我稍微整理下了下记录,如下:

下载地址:

MySQL5.7.18参数官方网址:https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_user_connections,下载完后的包是mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

上面的网址如果找不到,就来百度云盘下载:链接: https://pan.baidu.com/s/1bECiEM 密码: c2my



安装脚本myql_install_5.7.18.sh,可以执行脚本,实现这个一键式安装好mysql5.7.18:

#!/bin/bash
# install the basie lib
useradd mysql 
yum install cmake -y
yum install -y libtoolize
yum install gcc gcc-c++ -y
yum install -y ncurses-devel.x86_64
yum install -y cmake.x86_64
yum install -y libaio.x86_64
yum install -y bison.x86_64
yum install -y gcc-c++.x86_64

# unzip
rm -rf /usr/local/mysql-5.7.18*
tar -xvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /usr/local
mv /usr/local/mysql-5.7.18-linux-glibc2.5-x86_64 /usr/local/mysql3308
cp my.cnf /tmp/
cp /tmp/my.cnf /usr/local/mysql3308/my.cnf

# add mysql account,create the basic directory
rm -rf /home/data/mysql3308/data
mkdir -p /home/data/mysql3308/data
cd /home/data/mysql3308/data
chown -R mysql:mysql /usr/local/mysql3308
mkdir -p /home/data/mysql3308/binlog/
chown -R mysql:mysql /home/data/mysql3308/binlog/

# init databases
rm -rf /home/data/mysql3308/data/*
cd /usr/local/mysql3308/
time /usr/local/mysql3308/bin/mysqld --defaults-file=/usr/local/mysql3308/my.cnf --initialize-insecure --user=mysql

# “MySQL Enterprise Audit Security Considerations”
#mkdir -p /home/data/mysql/data/ssl/
chown -R mysql:mysql  /home/data/mysql/data/ssl
cd /usr/local/mysql3308/
time bin/mysql_ssl_rsa_setup --datadir=/home/data/mysql/data/ssl/

# set the auto start on linux server started
rm -rf /etc/init.d/mysqld3308*
cp support-files/mysql.server /etc/init.d/mysqld3308
chmod 700 /etc/init.d/mysqld3308
echo "export PATH=$PATH:/usr/local/mysql3308/bin">>/etc/profile 
chkconfig --add mysqld3308
source /etc/profile


vim /etc/init.d/mysqld3308
basedir=/usr/local/mysql3308
datadir=/home/data/mysql3308/data


# start the mysql server
echo "" > /usr/local/mysql3308/mysqld.log
chown -R mysql:mysql /usr/local/mysql3308/mysqld.log
service mysqld3308 start


启动报错:

[root@mydb1 mysql3308]# service mysqld3308 start
Starting MySQL SUCCESS! 
[root@mydb1 mysql3308]# 170605 15:26:25 mysqld_safe A mysqld process already exists

[root@mydb1 mysql3308]# 

后台error日志里面的启动报错信息:

2017-06-05T09:09:32.291104Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-06-05T09:09:32.292966Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170605 17:09:32
2017-06-05T09:09:32.304707Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-06-05T09:09:32.304749Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-06-05T09:09:32.304902Z 0 [Note] IPv6 is available.
2017-06-05T09:09:32.304930Z 0 [Note]   - '::' resolves to '::';
2017-06-05T09:09:32.304964Z 0 [Note] Server socket created on IP: '::'.
2017-06-05T09:09:32.305012Z 0 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
2017-06-05T09:09:32.305023Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2017-06-05T09:09:32.305041Z 0 [ERROR] Aborting

2017-06-05T09:09:32.305060Z 0 [Note] Binlog end



解决方法,以下2个操作即可
vim /etc/init.d/mysqld3308
(1)将basedir和datadir变成下面
basedir=/usr/local/mysql3308
datadir=/home/data/mysql3308/data

(2)
把所有的/usr/local/mysql变成/usr/local/mysql3308

然后重启搞定。

CentOS7下安装mysql-5.7.18

本文参考了: http://blog.csdn.net/peng314899581/article/details/70241976 http://www.cnblogs.com/pythonal/p...
  • heting717
  • heting717
  • 2017-05-11 18:20:41
  • 2150

Centos6编译安装Mysql5.7.18, rpm 安装mysql5.7.18,ubuntu apt安装mysql

关键字: centos 编译安装mysql5.7.18 rpm安装5.7.18,ubuntu apt -get 安装mysql 一. 编译安装前的准备1.1 卸载原有的Mysql在root用户下操...
  • T1DMzks
  • T1DMzks
  • 2017-05-07 22:00:06
  • 3904

Linux CentOS MySQL 5.7.18 5.7.X安装教程

Linux CentOS MySQL 5.7.18 5.7.X安装教程
  • guoxingege
  • guoxingege
  • 2017-04-24 10:53:56
  • 5808

centos7下安装mysql5.7.18

摘要: 本文简单介绍了centos7版本下安装mysql数据库。由于centos7和之前的版本差异较大,所以配置也੍... 1、安装环境介绍    操作系统:CentOS7 64位,MIN...
  • xiongfeng1314
  • xiongfeng1314
  • 2017-07-03 15:51:07
  • 1953

CentOS下安装mysql5.7.18的正确姿势

前段日子,学着在虚拟机上装一个mysql,但安了好几次都失败了,这让我很尴尬,感觉我还是比较适合mongodb。。。。。不过机智的我最终还是把Mysql5.7.18装好了,下面就给大家分享一下如何正确...
  • wopelo
  • wopelo
  • 2017-07-01 21:08:11
  • 1240

使用YUM在Linux(CentOS 7)下安装mysql 5.7.18

项目需要使用mysql,由于以前都是在windows下傻瓜式安装,基本没有遇到什么问题,但是这次是在服务器上安装,由于到linux上安装软件不熟悉,走了不少弯路,耽误了好多时间。总结下来,以免下次再走...
  • hwcptbtptp
  • hwcptbtptp
  • 2017-05-10 10:21:03
  • 1457

centos7安装mysql5.7.18完整实用教程(★firecat推荐★)

CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载https://downloads.mysql.com/archives/community/1、...
  • libaineu2004
  • libaineu2004
  • 2017-07-27 17:35:12
  • 1109

Centos7编译安装Mysql5.7.18, rpm 安装mysql5.7.18,ubuntu apt安装mysql

本文转载于:http://blog.csdn.net/t1dmzks/article/details/71374740 一. 编译安装前的准备 1.1 卸载原有的Mysql ...
  • qq_21577365
  • qq_21577365
  • 2017-06-17 22:36:47
  • 480

windows 10 下MySQL 5.7.18安装教程

一、 1、MySQL下载:http://www.mysql.com/进入页面Download Download MySQL Community Server 选择你想要的版本进行下载 这里我选...
  • Vincentlmeng
  • Vincentlmeng
  • 2017-04-13 17:54:06
  • 28156

mysql5.7.18+linux安装二进制包与运行

mysql5.7.18
  • acrux1985
  • acrux1985
  • 2017-04-11 13:56:33
  • 4535
收藏助手
不良信息举报
您举报文章:MySQL 5.7.18 在centos下安装记录
举报原因:
原因补充:

(最多只允许输入30个字)