Centos7.6安装mysql8.0

一、 yum安装步骤
1、Centos7.6 默认安装了mariadb数据库,这里把他移除:
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.64-1.el7.x86_64

2、添加MySQL Yum存储库
wget https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
yum localinstall mysql80-community-release-el7-3.noarch.rpm

3、 问题解决:Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
yum provides ‘*/applydeltarpm‘
yum install deltarpm -y

4、安装数据库
yum install mysql-community-server -y

5、启动测试:
service mysqld start
service mysqld status

二、二进制包安装
1、下载安装文件
mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz

2、解压文件
xz -d mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz
mkdir /usr/local/mysql
tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar -C /usr/local/

3、安装命令
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
cd /usr/local
ln -s /usr/local/mysql-8.0.18-linux-glibc2.12-x86_64 /usr/local/mysql
cd mysql
mkdir data
chown mysql:mysql data
chmod 750 data
./bin/mysqld --initialize --user=mysql

错误处理:./bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
yum -y install numactl

[[email protected]_0_13_centos mysql]# ./bin/mysqld --initialize --user=mysql
2020-01-08T13:46:42.040071Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.18-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.18) initializing of server in progress as process 19212
2020-01-08T13:46:46.850182Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: iB;ojnbO)0dM

./bin/mysql_ssl_rsa_setup
./bin/mysqld_safe --user=mysql &

# Next command is optional
cp support-files/mysql.server /etc/init.d/mysql.server

4、首次登陆后修改密码
mysql -uroot -p
输入第3步记下的密码
ALTER USER "root"@"localhost" IDENTIFIED WITH mysql_native_password BY "password";
FLUSH PRIVILEGES;
修改可以远程登录:
use mysql
select host,user from user;
update user set host=‘%‘ where user=‘root‘;
FLUSH PRIVILEGES;

原文地址:https://www.cnblogs.com/zutanhongke/p/12169128.html

时间: 2024-10-24 23:08:29

Centos7.6安装mysql8.0的相关文章

centos7.2 安装mysql8.0.11 并自动初始化root密码

1 下载mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar 2 mdkir –p /home/mysql/ 3 上传tar文件到/home/mysql 并解压 tar xvf mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar 4 cd /home/mysql  然后 createrepo . 5 vi /etc/yum.repos.d/mysql.repo [mysql] name=mysql baseurl=file:///home

centos7.5 安装mysql8.0

把这个rpm文件下载下来放到服务器上,或者在linux系统中通过wget命令下载 wget http://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm 下载完成后使用yum命令本地安装yum源 yum localinstall mysql80-community-release-el7-1.noarch.rpm 执行完毕后使用下面的命令检查是否安装成功 yum repolist enabled | grep "mysql

centos7 在线安装 mysql8.0

访问https://dev.mysql.com/downloads/repo/yum/上的MySQL Yum存储库下载页面 . 选择并下载适用于您的平台的发行包. 使用以下命令安装下载的发行包,替换 platform-and-version-specific-package-name 为下载的包的名称: shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpmshell> yum repolist all | gre

centos7在线安装mysql8.0.16

一.官网复制安装源地址: 1.进入官网地址:https://dev.mysql.com/downloads/repo/yum/ 二.进入/usr/local目录下 ,创建mysql文件夹 三.使用命令“yum install wget 安装wget,接下来在线安装mysql.使用命令  wget http://dev.mysql.com/get/Downloads/mysql80-community-release-el7-3.noarch.rpm 四.安装mysql80-community-r

Centos7.3安装Mysql8.0

下载rpm 安装 yum repo文件并更新 yum 缓存 rpm -ivh mysql80-community-release-el7-3.noarch.rpm 执行结果: 会在/etc/yum.repos.d/目录下生成两个repo文件mysql-community.repo mysql-community-source.repo 执行 yum clean all yum makecache 查看mysql yum仓库中mysql版本,使用如下命令 yum repolist all | gr

CentOS7.6使用yum安装MySQL8.0

CentOS7.6使用yum安装MySQL8.0 1.yum仓库下载MySQL:sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm 2.yum安装MySQL:sudo yum install mysql-community-server 3.启动MySQL服务:sudo service mysqld start 4.检查MySQL服务状态:sudo service m

centos 7下安装mysql-8.0

本篇文章主要介绍在centos7 环境下安装mysql8.0并设置为开机自启. 安装步骤 1.配置yum源 首先在 https://dev.mysql.com/downloads/repo/yum/ 找到 yum 源 rpm 安装包,但是我那会打开这个网页时有点慢毕竟是国外的网站,所以我分享到百度网盘了,链接:https://pan.baidu.com/s/1-gX5eN2QnSH5ptcxsIiq3Q 密码:pirb. 下载完成上传到服务器,我是传到了opt目录下. 2.安装mysql源 yu

centos7抢先安装docker1.0

1.关闭selinux [[email protected] ~]#setenforce 0 2.安装 Fedora EPEL [[email protected] ~]#yum install -y http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm 3.安装docker [[email protected] ~]#yum install -y docker-io [[email protecte

Centos7.2安装zabbix3.0

Centos7.2YUM安装zabbix3.0 防火墙和selinux关闭,这个我就不说了. 1.启动apache yum -y install httpd systemctl start httpd.service systemctl enable httpd.service systemctl status httpd.service 2. 启动mariadb yum install mariadb mariadb-server -y systemctl start mariadb syst