一、关闭防火墙
[root@node01 ~]# systemctl disable firewalld
[root@node01 ~]# systemctl stop firewalld
[root@node01 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1) 二、关闭selinux
[root@node01 ~]# vi /etc/selinux/config
SELINUX=disabled
[root@node01 ~]# getenforce
Disabled 临时关闭selinux
[root@node01 ~]# setenforce 0
setenforce: SELinux is disabled 三、卸载centos自带数据库
[root@node01 ~]# rpm -qa | grep mariadb | xargs -i yum remove -y {}
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Running transaction check
---> Package postfix.x86_64 2:2.10.1-6.el7 will be erased
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================
Package Arch Version Repository Size
=======================================================================================
Removing:
mariadb-libs x86_64 1:5.5.56-2.el7 @anaconda 4.4 M
Removing for dependencies:
postfix x86_64 2:2.10.1-6.el7 @anaconda 12 M Transaction Summary
=======================================================================================
Remove 1 Package (+1 Dependent package) Installed size: 17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 2:postfix-2.10.1-6.el7.x86_64 1/2
Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 2/2
Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/2
Verifying : 2:postfix-2.10.1-6.el7.x86_64 2/2 Removed:
mariadb-libs.x86_64 1:5.5.56-2.el7 Dependency Removed:
postfix.x86_64 2:2.10.1-6.el7 Complete!
[root@node01 ~]# rpm -qa | grep mariadb
[root@node01 ~]# 四、添加用户组及用户
[root@node01 ~]# groupadd mysql
[root@node01 ~]# useradd -g mysql mysql
[root@node01 ~]# id mysql
uid=1000(mysql) gid=1000(mysql) groups=1000(mysql)
[root@node01 ~]# passwd mysql
Changing password for user mysql.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@node01 ~]# 五、创建mysql相关目录
[root@node01 ~]# mkdir -p /data/mysql3306/data
[root@node01 ~]# mkdir -p /data/mysql3306/binlog
[root@node01 ~]# chown -R mysql.mysql /data* 六、下载mysql8.0安装包,上传并解压 下载地址:
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.18-linux-glibc2.12-x86_64.tar 解压mysql安装包:
[mysql@node01 ~]$ tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz 七、创建mysql安装包软连接
[root@node01 data]# ln -s /data/mysql-8.0.18-linux-glibc2.12-x86_64 /usr/local/mysql
[root@node01 data]# chown -R mysql.mysql /usr/local/mysql* 八、创建my.cnf参数文件
[root@node01 data]# vi /etc/my.cnf
[client]
port=3306
socket=/tmp/mysql.sock [mysqld]
port=3306
user=mysql
server_id=1
socket=/tmp/mysql.sock
basedir=/usr/local/mysql
datadir=/data/mysql3306/data
log-error=/data/mysql3306/data/error.log
log_bin=/data/mysql3306/binlog/mysql-bin 九、配置用户环境变量
[mysql@node01 ~]$ vi .bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin [root@node02 ~]# vi /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin 十、初始化mysql数据库
[mysql@node01 ~]$ mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql3306/data 十一、添加mysql服务
[root@node01 data]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld 十二、启动mysql数据库、登录数据库
[mysql@node01 ~]$ /etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
[mysql@node01 ~]$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18 MySQL Community Server - GPL Copyright (c) 2000, 2019, 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;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec) mysql> 十三、配置mysql数据库自动启动
[root@node01 data]# chkconfig --add mysqld
[root@node01 data]# chkconfig --list Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'. mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off

  

centos 7系统安装mysql 8.0的更多相关文章

  1. 阿里云CentOS自动备份MySql 8.0并上传至七牛云

    本文主要介绍一下阿里云CentOS7下如何对MySql 8.0数据库进行自动备份,并使用.NET Core 将备份文件上传至七牛云存储上,并对整个过程所踩的坑加以记录. 环境.工具.准备工作 服务器: ...

  2. CentOS 6.6 MySQL 8.0详细安装步骤

    1.备份服务器上MySQL数据库 [root@localhost ] # mysqldump -h localhost -u root -proot --databases Surpass --rou ...

  3. Win7系统安装 MySQL 8.0.11

    1. 下载 MySQL 8.0.11 版本 下载地址: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip 2. 下载 ...

  4. CentOS 7 安装MySQL 8.0.11

    1. 下载安装包 wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar 下载 ...

  5. CentOS 6 安装 MySQL 8.0.+

    1.先查询是否安装MySQL 大多数centos 6 自带 MySQL5.1 命令: rpm -qa|grep mysql 执行: [root@lifan ~]# rpm -qa|grep mysql ...

  6. Linux CentOS上安装 MySQL 8.0.16

    前言: 因为我需要在我新安装的Linux CentOS系统服务器中安装和配置MySQL服务器,然而对于我们这种Linux使用小白而言在Linux系统中下载,解压,配置MySQL等一系列的操作还是有些耗 ...

  7. CentOS 7 编译 mysql 8.0.12

    步骤一:安装mysql依赖 yum install -y libaio numactl 步骤二:下载mysql社区版 wget https://dev.mysql.com/get/Downloads/ ...

  8. centos docker 安装mysql 8.0

    centos 版本  CentOS Linux release 7.5.1804 (Core) 内核版本: 3.10.0-862.el7.x86_64 下载最新版mysql docker pull m ...

  9. CentOS下php使用127.0.0.1不能连接mysql的解决方法

    这篇文章主要介绍了CentOS下php使用127.0.0.1不能连接mysql的解决方法,本文原因是SELINUX导致的连接失败,需要的朋友可以参考下 php代码很简单: 复制代码代码如下: $ser ...

随机推荐

  1. window.frames["id"].location使用

    由于最近需要维护一个老项目不得不去学习一些自己都没接触过的项目,老项目中虽然技术已经被淘汰,但是思想还是值得去学习探究的,无论是jsp,freemarker,freemarker这些模板引擎还是Vue ...

  2. 攻防世界-Web_php_include (四种解法)

    攻防世界-Web_php_include   (考察的是文件包含) 打开页面是这样一段代码从代码中得知page中带有php://的都会被替换成空 str_replace()以其他字符替换字符串中的一些 ...

  3. OAuth 2.0授权框架详解

    目录 简介 OAuth的构成 refresh Token Authorization Code模式 隐式授权 Resource Owner 授权密码认证 Client 认证授权 github的OAut ...

  4. MindManager使用教程:如何导出HTML5交互式导图

    Mindmanager思维导图软件有着友好的用户界面以及丰富的思维导图制作功能.再搭配与Microsoft 软件的无缝集成功能,使得这款思维导图软件越来越受到职场人士的喜爱. 不仅是作为制作思维导图的 ...

  5. guitar pro系列教程(二十三):如何使用Guitar Pro制作扫弦

    前面的章节小编和大家讲解了很多关于Guitar Pro的使用功能,本章节我们将还是采用图文结合的方式和大家讲解如何使用Guitar Pro 制作扫弦,感兴趣的朋友可以进来看看哦. 扫弦的概念 对于很多 ...

  6. Vue最简单的实现网页Live2D看板娘

    Live2D看板娘 前言 二.使用步骤 1.引入 2.设置样式 结尾(后续更新更强的配置看板娘~) 前言 最近想给自己的网页添点新花样,然后就想到了别人的网站都有一些看板娘的玩意儿,看着很舒服,鉴于自 ...

  7. selenium元素定位检查

    自动化测试的重点就是定位元素,然而定位元素没办法一步一步运行调试检查,每次都需要从代码的开始运行,检查起来效率极低. 一直想找一个能检查唯一性工具或者方法.百度发现一篇文章https://blog.c ...

  8. Leetcode 周赛#202 题解

    本周的周赛题目质量不是很高,因此只给出最后两题题解(懒). 1552 两球之间的磁力 #二分答案 题目链接 题意 有n个空篮子,第i个篮子位置为position[i],现希望将m个球放到这些空篮子,使 ...

  9. 加快alter table

    mysql的alter table操作的性能对打表来说是个大问题. mysql执行大部分修改表结构的方法是用新的结构创建一个空表,从旧表中查出所有的数据插入新表,然后删除旧表.这样操作就可能需要花费很 ...

  10. MySQL中的事务原理和锁机制

    本文主要总结 MySQL 事务几种隔离级别的实现和其中锁的使用情况. 在开始前先简单回顾事务几种隔离级别以及带来的问题. 四种隔离级别:读未提交.读已提交.可重复读.可串行化. 带来的问题:脏读.不可 ...