1.下载二进制文件

cd /usr/local/src/
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz

2.创建MySQL组和用户

groupadd mysql
useradd -g mysql mysql
passwd mysql

3.创建安装目录、数据目录、配置目录等

mkdir -p /usr/local/mysql/
mkdir -p /usr/local/mysql/data
mkdir -p /usr/local/mysql/etc
mkdir -p /usr/local/mysql/log chown -R mysql:mysql /usr/local/mysql/

4.安装依赖包

yum install libaio numactl

5.安装mysql

su - mysql
cd /usr/local/src/
tar -xzvf mysql-5.7.-linux-glibc2.-x86_64.tar.gz
mv /usr/local/src/mysql-5.7.-linux-glibc2.-x86_64/* /usr/local/mysql/

6.创建my.cnf配置文件

cat > /usr/local/mysql/etc/my.cnf << EOF
[client]
port =
socket=/usr/local/mysql/mysql.sock
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/mysql.sock
log-error=/usr/local/mysql/log/mysqld.log
pid-file=/usr/local/mysql/data/mysqld.pid
lower_case_table_names = #不区分大小写
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
max_connections=
default-time_zone = '+8:00'
EOF

7.初始化mysql

/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
grep 'temporary password' mysqld.log #记录默认密码

8.设置开机启动

su - root
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --list
systemctl start mysqld

9.登录数据库并修改密码

[mysql@mysql log]$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. Copyright (c) , , 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> show databases;
ERROR (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> SET PASSWORD = PASSWORD('abc123');
Query OK, rows affected, warning (0.01 sec)
mysql> UPDATE `mysql`.`user` SET `Host` = '%', `User` = 'root' WHERE (`Host` = 'localhost') AND (`User` = 'root');
Query OK, row affected (0.00 sec)
Rows matched: Changed: Warnings: mysql> flush privileges;
Query OK, rows affected (0.00 sec) mysql> quit
Bye

1.下载二进制文件

Linux CentOS7.5上二进制安装MySQL5.7.23的更多相关文章

  1. 学以致用二十七-----Centos7.5二进制安装mysql5.7.23

    首先去官网查看mysql版本.才一个礼拜不到,我之前下载的是mysql5.7.23,现在在官网页面已然找不到了,只有5.7.24版本,不得不说更新真快.不过我下载的是mysql5.7.23,所以还是安 ...

  2. 021-centos6.5上二进制安装mysql5.7.22

    思路: 下载上传mysql的二进制安装包. 准备好mysql的用户.安装目录basedir.数据目录datadir.配置文件/etc/my.cnf. 初始化出数据库. 配置启动服务. 开机启动. 配置 ...

  3. Linux(CentOS7)下二进制安装MySQL5.7.26

    记录一下自己在 CentOS7 下二进制安装 MySQL5.7.26 的过程,之前使用 Linux(CentOS7)下rpm安装MySQL8.0.16 之后发现 rpm 方式安装不利于维护,也不利于单 ...

  4. Linux CentOS-7.0上安装Tomcat7

    Linux CentOS-7.0上安装Tomcat7   安装说明 安装环境:CentOS-7.0.1406安装方式:源码安装 软件:apache-tomcat-7.0.29.tar.gz 下载地址: ...

  5. Linux上centOs6+安装mysql5.7详细教程 - 前端小鱼塘

    https://coyhom.github.io/ 人类的本质是复读机,作为一个非linux专业人员学习linux最好的办法是重复 环境centos6.5 版本5.7 1: 检测系统是否自带安装mys ...

  6. CentOS7 实战源码安装mysql5.7.17数据库服务器

    CentOS7 实战源码安装mysql5.7.17数据库服务器 简介:实战演练mysql数据库服务器的搭建  mysql简介: mysql是一个开源的关系型数据库管理系统,现在是oracle公司旗下的 ...

  7. Linux CentOS7系统中mysql8安装配置

    mysql是世界上最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司所有.今天我将记录一下如何在Linux centos7系统上安装和配置MySQL. 目录 环境准 ...

  8. Kubernetes+Docker的云平台在CentOS7系统上的安装

    Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...

  9. 记录CentOS7.X版本下安装MySQL5.7数据库

    记录CentOS7.X版本下安装MySQL5.7数据库  设置rpm下载目录在/opt目录下新建一个目录存放mysql cd /opt sudo mkdir mysql12  下载MySQL的源 wg ...

随机推荐

  1. GoLand tool tips

    goland format code (on save ) preference -> tool -> file watcher  then ,select go fmt 2, highl ...

  2. benthos v1 的一些新功能

    主要从视频文件截取,暂时github 上还没有很全的相关文档 v1目标 config lint processor error 处理 subprocess processor awk processo ...

  3. oracle-sql内置函数

    函数  oracle 自定义函数入门 主题:ORACLE函数大全 ############################### set operators UNION, UNION ALL, INT ...

  4. zeromy quick start - python

    软件: pip install pyzmq 代码: ==server.py #  #   Hello World server in Python  #   Binds REP socket to t ...

  5. bootstrap-table设置表头宽度无效的解决方案

    bootstrap-table设置colmuns中某列的宽度无效时,需要给整个表设置css属性: .table { table-layout: fixed; }

  6. nexus 私有 maven 仓库的搭建

    下载地址 页面 : https://help.sonatype.com/repomanager3/download 首先需要安装jdk .安装棒法我 前面的文章有写.https://www.cnblo ...

  7. python核心类库:urllib使用详解

    python版本:2.7.15 1.简单用法urllib.urlopen() 语法:urllib.urlopen(url[, data[, proxies]]) :打开一个url的方法,返回一个文件对 ...

  8. Linux复制粘贴快捷键

    1. 在终端下: 复制命令:Ctrl + Shift + C 组合键.粘贴命令:Ctrl + Shift + V 组合键. 2. 在控制台下: 复制命令:Ctrl + Insert 组合键 或 用鼠标 ...

  9. padding margin

    padding:内边距 margin:外边距 内外边距是针对本标签相对于它相邻的标签而言. margin: 10px;是本标签与它周围上下左右有10像素的空白. padding: 10px;本标签其实 ...

  10. 编写dll时的内存分配策略

    前一篇文章介绍了为何要共用内存管理器,有人要问可不可以在编写dll时更通用一些,可以兼顾其它编译器(如果是其它编译器的话,Delphi写的dll不能与其它语言共用内存管理器),采用一定的策略来避免在d ...