一个朋友找我如何在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

然后重启搞定。

MySQL 5.7.18 在centos下安装记录的更多相关文章

  1. Centos下安装mysql 总结

    一.MySQL安装 Centos下安装mysql 请点开:http://www.centoscn.com/CentosServer/sql/2013/0817/1285.html 二.MySQL的几个 ...

  2. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  3. Centos下安装mysql 和挂载硬盘

    一,CentOS下安装Mysql 6.5 1.检测系统是否自带安装mysql # yum list installed | grep mysql 2.删除已经安装的Mysql # yum -y rem ...

  4. 【MySQL】CentOS下安装及搭建主从复制

    CentOS下安装MySQL 1,wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 2,rpm -ivh m ...

  5. centos下安装php环境

    centos下安装php环境 安装apache yum install httpd-devel 启动apache /etc/init.d/httpd start 安装mysql yum install ...

  6. CentOS下安装MYSQL8.X并设置忽略大小写

    安装 在官网上下载:mysql80-community-release-el7-2.noarch.rpm.安装方式与5.7基本相同.详细安装过程见:CentOS下安装mysql5.7和mysql8.x ...

  7. MySQL v5.7.18 版本解压安装

    下载MySQL https://dev.mysql.com/downloads/mysql/5.1.html#downloads 个人机子是64位的,所以选择下载:Windows (x86, 64-b ...

  8. MySQL 5.7.18 zip版本的安装使用方法

    转自:https://www.cnblogs.com/nepulgh/p/7152618.html MySQL 5.7.18 zip版本的安装使用方法 这个版本的MySQL不像那种点击就可以立即安装, ...

  9. CentOS下安装hadoop

    CentOS下安装hadoop 用户配置 添加用户 adduser hadoop passwd hadoop 权限配置 chmod u+w /etc/sudoers vi /etc/sudoers 在 ...

随机推荐

  1. crm--业务点详细概述

    一.CRM简介:(为什么开发CRM) 此项目主要供自己的公司使用,原来因为公司人员较少,人员管理考勤等都用excel保存.但是现在因为公司人员,以及部门增多,为了方便管理 ,供销售人员使用内部系统更方 ...

  2. ORACLE 多表连接与子查询

    Oracle表连接 SQL/Oracle使用表连接从多个表中查询数据 语法格式: select 字段列表from table1,table2where table1.column1=table2.co ...

  3. 子元素绝对定位absolute后,自动撑开宽度

    position: absolute;   white-space: nowrap;

  4. Calendar的那些神坑

    参考我的博客:http://www.isedwardtang.com/2017/08/31/java-calendar-bug/

  5. 格式化字符串--format用法

    print("hello {leon}".format(leon="world!")) #format 是一个格式化字符穿的方法. print("he ...

  6. JS相关方法总计

    1. 锚点的使用: 简单使用: <a href="#001">跳到001</a> ...文字省略 <a name="001" id ...

  7. FutureTask、Fork/Join、 BlockingQueue

    我们之前学习创建线程有Thread和Runnable两种方式,但是两种方式都无法获得执行的结果. 而Callable和Future在任务完成后得到结果.   Future是一个接口,表示一个任务的周期 ...

  8. Javascript中类型: undefined, number ,string ,object ,boolean

    var a1; var a2 = true;var a3 = 1;var a4 = "Hello";var a5 = new Object();var a6 = null;var ...

  9. Ubuntu gcc错误:对'log'等函数未定义的引用

    Ubuntu gcc错误:对'log'等函数未定义的引用 a.c #include <stdio.h>#include <math.h>int main(){    float ...

  10. 如何自定义echarts 线性图的选择事件

    最近在做公司的数据大盘,要用到图表显示,echarts研二的时候有用过,我就决定用它了. 这里用到一个可以同时显示多条曲线的line-charts,基本样子如下: 看到这个画红色圈圈的地方了吗??? ...