1、下载mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz(/opt目录)

2、tar -zxvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

3、改名称。mv mysql-5.7.24-linux-glibc2.12-x86_64 mysql,在mysql目录下创建data目录,mkdir data

4、在/etc下新建my.cnf。内容如下

#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
#symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/opt/mysql/data/mysqld.pid

#
# include all files from the config directory
#
#!includedir /etc/my.cnf.d
[client]
port = 3306
socket = /opt/mysql/mysql.sock
default-character-set=utf-8
[mysqld]
#skip-grant-tables
character_set_server=utf8
init_connect='SET NAMES utf8'
basedir=/opt/mysql
datadir=/opt/mysql/data
socket=/opt/mysql/mysql.sock
lower_case_table_names = 1
bind-address = 0.0.0.0
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

5、在/opt/mysql下新建文件mysql.sock。

touch mysql.sock
chown mysql:mysql mysql.sock
chmod 755 mysql.sock

6、

查看组和用户情况:cat /etc/group | grep mysql
查看组和用户情况:cat /etc/passwd |grep mysql

若存在,则删除原mysql用户:userdel -r mysql,会删除其对应的组和用户并在次查看。

创建mysql组:groupadd mysql
创建mysql用户:useradd -r -g mysql mysql
修改目录拥有者:chown -R mysql:mysql /opt/mysql

7、cd /opt/mysql/bin/目录

./mysqld --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/data --initialize(需要记住初始密码)

8、./mysqld_safe --user=mysql &

9、./mysql -u root -p

输入初始密码

10、改密码:mysql>set password=password("123456");

11、mysql>grant all privileges on *.* to 'root'@'%' identified by '123456';

12、flush privileges;

13、set global show_compatibility_56=on;

14、mysql> quit;

15、cp -a /opt/mysql/support-files/mysql.server /etc/init.d/mysql

16、ln -s /opt/mysql/bin/mysql /usr/bin

参考:

https://www.cnblogs.com/songyinan/p/10093288.html

https://blog.csdn.net/demored/article/details/54341246

https://blog.csdn.net/eagle89/article/details/78411184

https://www.jianshu.com/p/8cb0189a3278

安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64的更多相关文章

  1. 【原创】Linux基础之redhat6升级glibc-2.12到2.14

    redhat6自带glibc-2.12,升级到glibc-2.14过程 # strings /lib64/libc.so.6 |grep GLIBC_GLIBC_2.2.5GLIBC_2.2.6GLI ...

  2. secureCRT安装,破解,连接linux机器(含安装包)

    1. 为什么需要安装secureCRT 我们的项目运行在服务器上,如果出现什么问题,或者升级的时候,需要对服务器进行操作,把处理好的项目发布到服务器上.如果我们就在服务器身边,那么直接在服务器上进行操 ...

  3. 安装虚拟机与初触linux心得

    安装虚拟机与初触linux心得 安装虚拟机 不知道是电脑问题还是软件问题,我安装虚拟机的过程异常坎坷,首先我在官网,360,太平洋等地方下载的virtualbox5.0以后的软件普遍有问题,问题是打不 ...

  4. mycat 1.6.6.1安装以及配置docker 安装mysql 5.7.24 双主多从读写分离主主切换

    mycat和mysql的高可用参考如下两个图 简介:应用程序仅需要连接HAproxy或者mycat,后端服务器的读写分离由mycat进行控制,后端服务器数据的同步由MySQL主从同步进行控制. 服务器 ...

  5. Fedora 24 Linux 环境下实现 Infinality 字体渲染增强及 Java 字体渲染改善的方法(修订)

    Fedora 24 Linux 桌面环境默认字体渲染引擎 freetype 及字体配置工具 fontconfig 采用的是未经优化的编译及设置,字体渲染效果比较差.而某些 Linux 发行版的桌面字体 ...

  6. 如何安装win10+Red Hat Enterprise Linux双系统?

    1,如何安装win10+Red Hat Enterprise Linux双系统???? 有很多人(没做过调查,可能就我自己想装吧)想要安装Red Hat Enterprise Linux系统,但是又不 ...

  7. 【转载】安装和使用花生壳(linux)

    安装和使用花生壳(linux) 一.安装说明(以CentOS 5为例) 1.安装必要的开发包 [root@localhost ~]# yum install gcc gcc-c++ autoconf ...

  8. Linux 0.12 内核管理存储器

    Linux 0.12 内核管理存储器 其分段,用分段的机制把进程间的虚拟地址分隔开. 每一个进程都有一张段表LDT.整个系统有一张GDT表.且整个系统仅仅有一个总页表. 其地址翻译过程为: 程序中给出 ...

  9. 安装Redmine 2.3.0(Ubuntu 12.04 Server)

    怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ 安装Redmine 2.3.0(Ubuntu 12.04 Server) 翻译源\参考源 ...

  10. 由安装两块网卡的linux系统中引起网络不通想到的

    由安装两块网卡的linux系统中引起网络不通想到的 一天,小王突然急匆匆的来找我,他说:"我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping 自己的两块网 ...

随机推荐

  1. linux实操_硬盘

    1.硬盘分区 硬盘说明: 查看分区和挂载情况 语法: lsblk -f lsblk 2.增加硬盘 (1)虚拟机添加硬盘 (2)分区 fdisk /dev/sdb (3)格式化 mkfs -text4 ...

  2. Vim键盘图-红色圈标记为重点

  3. hexo主题next 7.X版本配置美化

    我们主要对next主题进行了如下配置操作.效果可以前往https://www.ipyker.com 查看. 也可以前往https://github.com/ipyker/hexo-next-theme ...

  4. koa常用api文档整理

    koa 支持的配置 1.应用配置是 app 实例属性,目前支持的配置项如下 配置项名称 简介 app.name 应用名称(可选项) app.env 默认为 NODE_ENV 或者 developmen ...

  5. 03_已解决 [salt.master :2195][ERROR ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

    总结: 对于python2.7环境下的salt来说,要安装pip install mysql-python 对于python3环境下的salt来说,pip install mysqlclient的时候 ...

  6. sql server 知识整理 isnull函数()

    exec sp_helptext ProPrecode_matcode_uf exec sp_helptext 存储过程名字 isnull 函数() SQL Serve中的isnull()函数: is ...

  7. Active Directory 常用属性

    1.获取DirectoryEntry string str = string.Empty; string strPath = @LDAP://testDomain.com.mo; string ad  ...

  8. [Luogu] 打砖块

    题面:https://www.luogu.org/problemnew/show/P1174 题解:https://www.zybuluo.com/wsndy-xx/note/1145569

  9. c实现双向链表

    实现双向链表:创建.插入.删除 #include <iostream> #include <stdio.h> #include <string.h> #includ ...

  10. [python]函数默认参数顺序问题

    python 函数参数定义有四类: 1.必选参数:调用函数时候必须赋值的参数. a,须以正确的顺序传入函数b,调用时的数量必须和声明时的一样 def exa(x): return x #b作为参数进入 ...