https://dev.mysql.com/downloads/mysql/
Linux-Generic

md5sum mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

Linux环境检查

1 关闭numa

[root@node130 ~]#  vim /boot/grub/grub.conf
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=cb7d8bdc-28a5-4dbd-b04a-3ad9ee3e6bba rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off

[root@node130 ~]# numactl --hardware

[root@node130 ~]#numactl --show

2限制设置 /etc/security/limits.conf
[root@node130 ~]# vim /etc/security/limits.conf
* soft    nofile  1024000
* hard    nofile  1024000
* soft    nproc   unlimited
* hard    nproc   unlimited
* soft    core    unlimited
* hard    core    unlimited
* soft    memlock unlimited
* hard    memlock unlimited

3 Swap
[root@node130 ~]# vim /etc/sysctl.conf
vm.swappiness=0

sysctl -p 生效
[root@node130 ~]# sysctl -a|grep swap
vm.swappiness = 0

6 selinux & iptables

selinux:
[root@node130 ~]# vim /etc/sysconfig/selinux
SELINUX=disabled
SELINUXTYPE=targeted

[root@node130 ~]# getenforce
Disabled

setenforce 0
getenforce

chkconfig --list|grep iptables
chkconfig --del iptables

[root@node130 ~]# chkconfig --list|grep iptables
iptables        0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@node130 ~]# chkconfig --del iptables
[root@node130 ~]# chkconfig --list|grep iptables

[root@node130 ~]# reboot

1创建账户
[root@node130 home]# groupadd mysql
[root@node130 home]# useradd -g mysql -d /user/local/mysql -s /sbin/nologin -M mysql
[root@node130 home]# id mysql
uid=505(mysql) gid=506(mysql) groups=506(mysql)

[root@node130 home]# mkdir /opt/mysql
[root@node130 mysql]# tar xvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

[root@node130 ~]# cd /usr/local/
cd /user/local/
[root@node130 local]# ln -s /opt/mysql/mysql-5.7.18-linux-glibc2.5-x86_64 mysql

[root@node130 local]# chown -R mysql:mysql mysql/

[root@node130 mysql]# echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile
[root@node130 mysql]# source /etc/profile

/data 是一个单独挂载的分区

[root@node130 mysql]# mkdir -p /data/mysql/mysql_3306/{data,logs,tmp}

[root@node130 mysql_3306]# chown -R mysql:mysql /data/mysql/mysql_3306/

[root@node130 ~]# cp /opt/my.cnf /etc/

初始化

[root@node130 mysql]# ./bin/mysqld  --defaults-file=/etc/mysql3306.cnf --initialize
[root@node130 mysql]# cat /data/mysql/mysql_3306/data/error.log |grep password
2017-04-28T06:36:55.453219Z 1 [Note] A temporary password is generated for root@localhost: rFcPw<f;k4+1

启动

[root@node130 mysql]# cp support-files/mysql.server /etc/init.d/mysql
[root@node130 mysql]# /etc/init.d/mysql start
Starting MySQL...................... SUCCESS!
cp support-files/mysql.server /etc/init.d/mysql

or

[root@node130 ~]# /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf &
[1] 2787

[root@node130 tmp]# mysql -S /tmp/mysql.sock -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18-log

Copyright (c) 2000, 2017, 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.

"(unknown)@localhost:mysql.sock  [(none)]>alter user user() identified by '123456';
Query OK, 0 rows affected (0.01 sec)

"root@localhost:mysql.sock  [(none)]>show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.09 sec)

"root@localhost:mysql.sock  [(none)]>exit
Bye
[root@node130 etc]# mysqladmin -S /tmp/mysql.sock -p shutdown
Enter password:

Linux 安装MySQL5.7.18的更多相关文章

  1. linux安装MySQL5.7记录

    目录 linux安装MySQL5.7记录 1. 在根目录下创建文件夹/software和数据库数据文件/data/mysql 2. 从官网下载相应的MySQL版本 3. 解压并移动到/software ...

  2. linux 安装 mysql-5.6.26

    linux安装mysql-5.6.26 查看工具:winscp 下载地址 http://mirrors.sohu.com/mysql/MySQL-5.6/ 文件: mysql-5.6.26-linux ...

  3. Kali 2019(debian linux)安装MySql5.7.x

    Kali 2019(debian linux)安装MySql5.7.x MySQL安装 确认是否安装MySQL 终端输入:mysql 如出现Welcome to the MariaDB monitor ...

  4. Linux安装MySql5.7及配置(yum安装)

    Linux安装MySql5.7及配置(yum安装) [root@xld ~]# rpm -q centos-release centos-release-7-7.1908.0.el7.centos.x ...

  5. centos系统下安装MySQL5.7.18

    1.首先安装依赖包 yum install -y gcc gcc-c++ ncurses-devel perl openssl-devel 最最重要的是,不要忘了安装openssl-devel 2.安 ...

  6. Linux安装mysql5.7版本

    1.linux安装mysql5.7顺序 ①mysqladmin –version 查看版本号 ②mysql5.7安装在linux中需要先初始化 Mysqld –initialize –user=mys ...

  7. Linux下MySQL5.7.18 yum方式从卸载到安装

    本文出处:http://www.cnblogs.com/wy123/p/6932166.html 折腾了大半天,看了想,想了看,总算是弄清楚yum安装的过程了,之前写过二进制包安装的,这里用yum安装 ...

  8. Linux下MySQL5.7.18二进制包安装(无默认配置文件my_default.cnf)

    最新在学习MySQL,纯新手,对Linux了解的也不多,因为是下载的最新版的MySQL(MySQL5.7.18)二进制包,CentOS7.2下测试安装,方便以后折腾.大概步骤如下,安装删除反复折腾了几 ...

  9. Linux下MySQL5.7.18二进制包安装(手动添加配置文件my_default.cnf)

    本文出处:http://www.cnblogs.com/wy123/p/6815049.html 最新在学习MySQL,纯新手,对Linux了解的也不多,因为是下载的最新版的MySQL(MySQL5. ...

随机推荐

  1. javascript 数组 常用方法

    前言  学学忘忘  闲来做个笔记 整理下数组常用方法. Array 数组常用方法  创建数组的基本方式有两种    1.第一种是使用Array构造函数,  var arr = new Array(); ...

  2. Git 基础教程 之 添加远程仓库

    b, 本地内容推送至远程库上         git push -u origin master        实际上是把当前分支master推送到远程仓库,第一次推送时,加上-u参数, 表示Git不 ...

  3. 2、在1.VMware虚拟机上安装ubantu系统

    1.新建新的虚拟机系统 2.使用自定义高级安装 3.选择下一步操作 4.选择稍后安装 4.因为我们要安装的是Linux的发行版本ubuntu,所以这里选择Linux(L),版本是Ubuntu 64位, ...

  4. jetty+httpClient使用

    背景: 看了https://www.cnblogs.com/donlianli/p/10954716.html这篇文章之后,突然发现自己的知识面太窄了,连这些几乎可以说基础的工具都没怎么用过,于是决定 ...

  5. oracle启动停止命令

    dba 连接 oracle(切到 oracle 用户) sqlplus /nolog conn / as sysdba 登录成功之后,关闭数据库服务 shutdown immediate 登录成功之后 ...

  6. BZOJ 2085 luogu P3502 [POI2010]Hamsters (KMP、Floyd、倍增)

    数组开小毁一生-- 题目链接: https://www.lydsy.com/JudgeOnline/problem.php?id=2085 这题在洛谷上有个条件是"互不包含",其实 ...

  7. [bzoj2124]等差子序列_线段树_hash

    等差子序列 bzoj-2124 题目大意:给定一个1~n的排列,问是否存在3个及以上的位置上的数构成连续的等差子序列. 注释:$1\le n\le 10^4$. 想法:这题就相当于是否存在3个数i,j ...

  8. Linux Storage Stack Diagram 4.0

    https://www.thomas-krenn.com/en/wiki/Linux_Storage_Stack_Diagram

  9. STL之rb_tree的find函数

    1 通用的search方法 STL在实现对特定key值的查找时,并没有採用通用的方法: BRTreeNode * rb_tree_search(RBTreeNode * x, int key){ wh ...

  10. POJ 1084

    WA了好久,第一次用重覆盖的模型做题.感觉这题有个陷阱,那就是当去掉某些边后,若因为这个边去掉而被破环的正方形还存在,那么就会造成覆盖不完全,WA. 所以,在去掉边后,必定有些正方形是不存在的,须重新 ...