暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

CentOS7.6 安装部署 MySQL 8.0.28(yum)

原创 代野(Tank) 2022-02-22
3988

MySQL 8.0.28
CentOS 7.6

在安装MySQL前,首先需要确定安装的版本及发行的安装包格式。

确定安装开发版还是GA(General Availability)版本,开发版拥有最新的特性,但是不建议在生产环境使用。GA版本也称为生产版或稳定版,适用于生产环境使用。MySQL建议使用最新的GA版本。

1. 环境准备

清理系统默认集成的 mariadb

rpm -qa | grep mariadb-libs* mariadb-lib-5.5.60-1.el7_5.x86_64 rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64

关闭防火墙

--关闭服务 systemctl stop firewalld.service --关闭自启 systemctl disable firewalld.service

关闭 selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0 getenforce

2. 下载 rpm 包

方式一:离线下载

浏览器访问地址:https://dev.mysql.com/downloads/repo/yum/

image.png

方法二:在线 wget

yum install -y wget wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm

3. 安装 MySQL

yum install -y mysql80-community-release-el7-5.noarch.rpm

image.png

yum install -y mysql-community-server

image.png

启动 MySQL Server

systemctl start mysqld systemctl status mysqld

修改临时密码

grep 'temporary password' /var/log/mysqld.log

image.png

mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'ShardingSphere@2022';

配置允许远程登录

USE mysql; UPDATE user SET host = '%' WHERE user = 'root'; FLUSH PRIVILEGES;

创建测试库

CREATE DATABASE ds_1;

4. DBeaver 登陆验证

需要在“驱动”-“连接属性”中添加 allowPublicKeyRetrieval=true 属性

image.png

image.png
image.png

参考

[1]MySQL :: MySQL 8.0 Reference Manual :: 2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository

[2]centos7.0利用yum快速安装mysql8.0 - 姜飞祥 - 博客园 (cnblogs.com)


Tank

2022.2.6

最后修改时间:2022-02-23 01:19:16
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论