centos7安装mysql8.0.31版本

2023-05-16

目录

  • 1. 卸载mariadb
  • 2. 下载
  • 3. 安装
  • 4. 修改/etc/my.cnf
  • 5. 启动
  • 6. 修改密码

1. 卸载mariadb

因centos7默认安装了mariadb, 会造成依赖冲突,按下列方式进行卸载:

[root@canal ~]# 
[root@canal ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.68-1.el7.x86_64
[root@canal ~]# 
[root@canal ~]# rpm -e mariadb-libs --nodeps
[root@canal ~]# 
[root@canal ~]# rpm -qa | grep mariadb
[root@canal ~]# 
[root@canal ~]# 

2. 下载

[root@canal ~]# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.31-1.el7.x86_64.rpm-bundle.tar

[root@canal ~]# mkdir mysql-8.0.31
[root@canal ~]# 
[root@canal ~]# tar -xvf mysql-8.0.31-1.el7.x86_64.rpm-bundle.tar -C mysql-8.0.31
mysql-community-client-8.0.31-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.31-1.el7.x86_64.rpm
mysql-community-common-8.0.31-1.el7.x86_64.rpm
mysql-community-debuginfo-8.0.31-1.el7.x86_64.rpm
mysql-community-devel-8.0.31-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.31-1.el7.x86_64.rpm
mysql-community-icu-data-files-8.0.31-1.el7.x86_64.rpm
mysql-community-libs-8.0.31-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.31-1.el7.x86_64.rpm
mysql-community-server-8.0.31-1.el7.x86_64.rpm
mysql-community-server-debug-8.0.31-1.el7.x86_64.rpm
mysql-community-test-8.0.31-1.el7.x86_64.rpm
[root@canal ~]# 

3. 安装

[root@canal mysql-8.0.31]# yum install -y perl.x86_64
[root@canal mysql-8.0.31]# 
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-common-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-client-plugins-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-libs-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-client-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-icu-data-files-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# rpm -ivh mysql-community-server-8.0.31-1.el7.x86_64.rpm
[root@canal mysql-8.0.31]# 

4. 修改/etc/my.cnf

添加以下内容:

log_timestamps = SYSTEM

5. 启动

[root@canal mysql-8.0.31]# systemctl start mysqld
[root@canal mysql-8.0.31]# 
[root@canal mysql-8.0.31]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since 五 2022-11-18 06:59:53 CST; 1s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 1595 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 1668 (mysqld)
   Status: "Server is operational"
   CGroup: /system.slice/mysqld.service
           └─1668 /usr/sbin/mysqld

11月 18 06:59:48 single systemd[1]: Starting MySQL Server...
11月 18 06:59:53 single systemd[1]: Started MySQL Server.
[root@canal mysql-8.0.31]# 

6. 修改密码

[root@canal mysql-8.0.31]# 
[root@canal mysql-8.0.31]# cat /var/log/mysqld.log | grep password
2022-11-18T06:59:49.967603+08:00 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: d:fAhy+G)8uw
[root@canal mysql-8.0.31]# 
[root@canal mysql-8.0.31]# mysql -u root -pd:fAhy+G\)8uw
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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>
mysql> alter user 'root'@'localhost' identified by 'Root_123';
Query OK, 0 rows affected (0.00 sec)

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select user, host from user where user='root';
+------+-----------+
| user | host      |
+------+-----------+
| root | localhost |
+------+-----------+
1 row in set (0.00 sec)

mysql> update user set host ='%' where user='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> 
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.31    |
+-----------+
1 row in set (0.00 sec)

mysql>

MySQL8.0提供的授权方式采用SHA256基础的密码加密方法

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

centos7安装mysql8.0.31版本 的相关文章

  • 下载 CentOS 7 – DVD ISO 映像

    CentOS 是一个 Linux 操作系统 它是 Red Hat Enterprise Linux 100 兼容的重建版 用户可以免费下载并使用该企业级操作系统 CentOS 项目宣布了发行版的新更新 发布了CentOS 7 9它源自 Re
  • CentOS7修改SSH端口

    CentOS7 修改SSH端口 文章目录 CentOS7 修改SSH端口 1 修改ssh配置文件 1 1 查看默认端口 1 2 修改端口 2 防火墙放行 2 1 查看防火墙状态 2 2 防火墙放行端口 202 2 3 查看已开启端口 2 4
  • BSC(币安智能链)主网链部署

    文章目录 一 BSC主链镜像生成 二 BSC主链容器生成 2 1 下载BSC主网配置文件 2 2 新建初始化创始区块文件脚本 2 3 本地写入创世状态 2 4 新建BSC链启动脚本 2 5 启动BSC主网链 三 查看BSC服务是否部署成功
  • MariaDB 10.2 和 Openssl 1.1.0e 出现“不完整类型 MD5_CONTEXT”错误

    我无法在 CentOS 7 中构建启用 RocksDB 的 MariaDB 10 2 它有以下编译错误 root mariadb 10 2 mysys ssl my md5 cc In function void md5 result MD
  • CentOS 7 上 kibana 的 Nginx 无限重定向

    我没有反向代理的经验 更不用说 nginx 并且正在挣扎 版本 基巴纳 5 6 nginx 1 10 2 当我去elk mydomain com kibana 我会循环重定向 直到 Firefox 在出现如下超长链接后阻止我 http el
  • PHP 警告:第 0 行的未知模块已加载

    在 Mac OSX Mavericks 上使用 homebrew php55 每当我运行 php 命令时 我都会收到以下错误消息 一切运行正常 只是很烦人 PHP Warning Module intl already loaded in
  • 在 Apache Web 服务器上部署 Angular 4 应用程序

    我想在我的 Apache Web 服务器上部署我的 Angular 应用程序 我已经添加了一个 htaccess文件到我的 var www html文件夹中 我尝试了几个base hrefs 但和很多人一样 我在路由方面也遇到了问题 我只能
  • 如何在centOS 7中启动apache

    我使用以下命令启动 Apache service httpd start in centOS6 今天我下载了centOS7 64bit minimal并想在安装后启动 Apache 当我使用service httpd start 操作系统会
  • 系统上未安装 docker-runc

    我最近更新了基于 Centos 7 的机器 从那时起 我无法启动任何码头工人 有人对这个问题有经验吗 如果有 你是如何解决的 感谢您的宝贵帮助 错误日志下方 docker run it centos6 labs ompi161 devtoo
  • 无法安装 phpMyAdmin 错误:php71w-common 与 php-common-5.4.16-43.el7_4.1.x86_64 冲突

    我刚刚安装了 CentOS 7 和 PHP 7 1xx 和 MySQL 但无法安装 phpMyAdmin 我有一条错误消息 但在 Google 上没有答案 是的 只有一个答案 但它本身给了我相同的错误消息 rpm iUvh http dl
  • 如何在 centos 7 上链接 python3 以使用 openssl11/或最新版本的 openssl (1.1.1)

    我们想在centos 7中升级OpenSSL但没有成功 原因可能是这样的 通过 yum install openssl11 将 CentOS 7 升级到 OpenSSL 1 1 1 https stackoverflow com quest
  • Centos 7 中 mysqld.service 作业失败

    OS Centos 7 Linux 3 10 0 229 el7 x86 64 MySQL mysql57 community release el7 7 noarch rpm 我通过安装MySQL服务器yum 当我跑步时systemctl
  • 在我的 CentOS 机器上找不到wireshark init.lua

    所以我试图在我的 CentOS 7 服务器上获取一个与 tshark 一起使用的脚本 但我遇到了问题 该脚本在我的Windows笔记本电脑上运行良好 我只是将其放在appdata的plugins文件夹中 但我在linux上找不到类似的位置
  • Composer proc_open():分叉失败 - 无法分配内存

    我在运行时遇到与其他人相同的错误php composer phar update The following exception is caused by a lack of memory and not having swap confi
  • git-http-backend 与 apache2.4 Centos 7

    我尝试在我的 apache 服务器上设置 Git 服务器 但它不起作用 我得到了以下 git conf SetEnv GIT PROJECT ROOT var www html git project1 SetEnv GIT HTTP EX
  • 如何在 CentOS 7.2 上使用 yum 安装 gcc 5.3?

    我使用的是CentOS 7 2 当我使用yum groupinstall Development Tools gcc版本是4 8 5 像这样 我想安装 gcc 5 3 如何解决这个问题yum Update 通常人们想要最新版本的 gcc 并
  • Docker 错误:仅允许一个“主机”网络实例[重复]

    这个问题在这里已经有答案了 我正在尝试运行一个容器 其中我需要将网络驱动程序用作 主机 而不是 桥接器 我在 Centos 机器上运行它 我的 docker compose yml 是 version 3 4 services testCo
  • 如何使用 devtoolset-8-gcc 安装 gcc8

    我使用的是 CentOS Linux 版本 7 3 1611 其中安装了 gcc 4 8 5 20150623 我正在寻找一种安装较新版本的 gcc 的方法 特别是 8 1 我找到了以下关于如何安装 gcc v7 的网站link 1 htt
  • 为什么“git pull”在我的网络服务器上失败?

    我使用 git 来提取站点代码库的更改 文件内部的更改和文件删除是有效的 但是 当我将新文件或目录 不是空的 添加到存储库时 它不会被本地拉到网络服务器 拉动时不会显示错误消息 但在检查该文件时 它不在那里 在线的 bitbucket re
  • 如何修复 Centos 上的 Git Segmentation 错误

    我收到分段错误错误 无法在服务器上提取代码 Centos 7 这就是我遇到错误的方法 通过使用以下命令来验证我的服务器是否使用 bitbucket 进行身份验证 ssh T email protected cdn cgi l email p

随机推荐