1.mysql数据库-8.0.20版本安装
-
MySQL 分支
Oracle
Percona
Mariadb
RDS
TX -
MySQL 企业版本选择
5.7 : 5.7.28+
8.0 : 8.0.18+
GA 6-12月版本,GA15-20版本以上的.
-
获取软件
https://downloads.mysql.com/archives/community/ -
安装MySQL 8.0.20
4.1 准备操作系统环境
略
4.2 上传和解压
[root@db01 opt]# tar xf mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz
[root@db01 opt]# ln -s /opt/mysql-8.0.20-linux-glibc2.12-x86_64 /usr/local/mysql
[root@db01 mysql]# vim /etc/profile
export PATH=/usr/local/mysql/bin:$PATH
[root@db01 mysql]# source /etc/profile
[root@db01 mysql]# mysql -V
mysql Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)
4.3 卸载无用软件
[root@db01 ~]# yum remove -y mariadb-libs
4.4 创建用户
[root@db01 ~]# useradd mysql
4.5 创建目录并授权
[root@db01 ~]# mkdir -p /data/3306/data
[root@db01 ~]# chown -R mysql. /data
4.6 准备配置文件
[root@db01 ~]# vim /etc/my.cnf
[mysqld]
user=mysql
basedir=/usr/local/mysql
datadir=/data/3306/data
socket=/tmp/mysql.sock
[mysql]
socket=/tmp/mysql.sock
4.7 初始化MySQL系统数据
[root@db01 mysql]# yum install -y libaio-devel
[root@db01 mysql]# mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/3306/data
++++++++++++++++++++++++
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
2020-12-14T10:25:50.587761Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
++++++++++++++++++++++++
正确的输出:
[root@db01 mysql]# mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/3306/data
2020-12-14T10:27:26.083747Z 0 [System] [MY-013169] [Server] /opt/mysql-8.0.20-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.20) initializing of server in progress as process 2205
2020-12-14T10:27:26.176690Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-12-14T10:27:31.329930Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-12-14T10:27:34.098237Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
[root@db01 mysql]#
4.8 准备启动脚本
[root@db01 support-files]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
sys-v :
[root@db01 support-files]# service mysqld restart
Shutting down MySQL… SUCCESS!
Starting MySQL… SUCCESS!
[root@db01 support-files]#
systemd:
[root@db01 support-files]# systemctl enable mysqld
mysqld.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mysqld on
[root@db01 support-files]#
[root@db01 support-files]# systemctl restart mysqld
[root@db01 support-files]# systemctl stop mysqld
本文地址:https://blog.csdn.net/xiaoleinb/article/details/111997564
上一篇: 地多煤贱,鄂尔多斯成了比特币挖矿者的天堂
下一篇: 5G相关专业名词解释
推荐阅读
-
MySQL5.7.24版本的数据库安装过程图文详解
-
Linux下安装MariaDB数据库问题及解决方法(二进制版本的安装)
-
win7系统安装2个mysql版本后连接不上数据库的问题如何解决?
-
mysql 5.7.21解压版本安装 Navicat数据库操作工具安装
-
在windows上安装不同(两个)版本的Mysql数据库
-
1.mysql数据库-8.0.20版本安装
-
MySQL数据库压缩版本安装与配置详细教程
-
MySQL8.0.20压缩版本安装教程图文详解
-
Linux下安装MariaDB数据库问题及解决方法(二进制版本的安装)
-
Linnux下Oracle 10G和Oracle 11G双版本数据库并存的安装和配置