Centos7上安装MySQL community步骤

2023-05-16

下载mysql80-community-release-el7-3.noarch.rpm软件源包文件 

MySQL Community Yum Repository Downloads

shell> sudo yum localinstall mysql80-community-release-el7-3.noarch.rpm

列出可安装的MySQL版本:

shell> yum repolist all | grep mysql

列表如下:

Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
mysql-cluster-7.5-community/x86_64 MySQL Cluster 7.5 Community   disabled
mysql-cluster-7.5-community-source MySQL Cluster 7.5 Community - disabled
mysql-cluster-7.6-community/x86_64 MySQL Cluster 7.6 Community   disabled
mysql-cluster-7.6-community-source MySQL Cluster 7.6 Community - disabled
mysql-cluster-8.0-community/x86_64 MySQL Cluster 8.0 Community   disabled
mysql-cluster-8.0-community-source MySQL Cluster 8.0 Community - disabled
mysql-connectors-community/x86_64  MySQL Connectors Community    enabled:    118
mysql-connectors-community-source  MySQL Connectors Community -  disabled
mysql-tools-community/x86_64       MySQL Tools Community         enabled:     95
mysql-tools-community-source       MySQL Tools Community - Sourc disabled
mysql-tools-preview/x86_64         MySQL Tools Preview           disabled
mysql-tools-preview-source         MySQL Tools Preview - Source  disabled
mysql55-community/x86_64           MySQL 5.5 Community Server    disabled
mysql55-community-source           MySQL 5.5 Community Server -  disabled
mysql56-community/x86_64           MySQL 5.6 Community Server    disabled
mysql56-community-source           MySQL 5.6 Community Server -  disabled
mysql57-community/x86_64           MySQL 5.7 Community Server    disabled
mysql57-community-source           MySQL 5.7 Community Server -  disabled
mysql80-community/x86_64           MySQL 8.0 Community Server    enabled:    129
mysql80-community-source           MySQL 8.0 Community Server -  disabled

默认安装最新版本的MySQL,如果要安装低版本(如5.7)的需要切换软件源的版本:

shell> sudo yum-config-manager --disable mysql80-community
shell> sudo yum-config-manager --enable mysql57-community

切换之后/etc/yum.repos.d/mysql-community.repo 文件将会发生变化

 

好了,开始安装

shell> sudo yum install mysql-community-server

安装完成启动服务:

shell> sudo service mysqld start
Starting mysqld:[ OK ]

或者

shell> sudo systemctl start mysqld
Starting mysqld:[ OK ]

首次启动时会做服务初始化,并创建'root'@'localhost 的账号密码,可通过一下命令查看:

shell> sudo grep 'temporary password' /var/log/mysqld.log

登录并修改密码:

shell> mysql -uroot -p

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

 

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

Centos7上安装MySQL community步骤 的相关文章

随机推荐

  • Opencv调取摄像头失败的处理方法

    最近想学习一下opencv xff0c 就弄了一本 学习opencv 的书看 xff0c 书中的例子也随便敲一敲 可是 xff0c 在调去摄像头时出现了如下问题 具体代码如下 xff1a include 34 stdafx h 34 inc
  • Python编辑器 Sublime text2 +JEDI(python自动补全插件)

    以前写python的时候都是用eclipse写的 用mac后 xff0c 今天突然看到了这个Sublime text2 xff0c 目测很好用 先记下来 xff0c 到时再来补充 Win Linux gt cmd 43 shifp 43 p
  • 连接MySQL出现Host is not allowed to connect to this MySQL server 解决方法

    一 报错的原因 xff1f 英语翻译 不允许主机连接到此MySQL服务器 xff08 意思是本地账号连接可以登录 xff0c 但是远程登陆不行 xff09 二 解决步骤 1 打开cmd 进入到php的bin文件 2 以下命令按顺序执行 1
  • Debian 安装并切换配置使用 Xfce 4 桌面环境

    1 首先 使用 sudo tasksel 选择安装 Xfce 4 环境 或者 通过 sudo apt install kali defaults kali root login desktop base xfce4 xfce4 places
  • Qt 设置Widget背景图片并实现透明度的三种方式

    一 场景 在平常的开发过程中 xff0c 我们常常会遇到需要设置Widget窗口背景图片透明度的方式 一般会有三种方式可以进行设置 二 方式一 xff08 使用图形遮罩功能SetMask函数 xff09 class BackGroundWi
  • 穿山甲的广告聚合平台-GroMore

    很多同学微信私聊问我 xff0c TogetherAd 和其他市面上的广告聚合平台有什么区别 xff1f 接了你这个收入会不会提高啊 xff1f 毕竟个人时间有限 xff0c 我很难每个同学都去详细的回答 这篇文章我们就深入的探讨一下 我见
  • 使用Python的Tkinter库创建GUI(附实例:回归)

    我们前面介绍了树回归中的回归树和模型树 两种回归方式 本节我们首先将树回归和标准回归进行比较 xff0c 然后创建出一个GUI xff0c 通过交互的形式更好去观察模型树和回归树之间的奥秘 1 树回归与标准回归的比较 我们之前介绍过几种回归
  • django-模板语言-传输各种数据类型

    复习 django的三种返回方式 HttpResponse render redirect 了解这三个功能的导入位置 from django shortcuts import HttpResponse render redirect 模板语
  • 数据结构—顺序表

    目录 绪论 逻辑结构 xff1a 数据的逻辑结构可以看作从具体问题抽象出来数学模型 xff0c 他与数据的存储无关 A 集合结构 B 线性结构 C 树形结构 D 图形结构 物理结构 xff1a 是指数据的逻辑结构在计算机中的存储形式 xff
  • C语言 求2*3矩阵的转置

    C语言 求2 3矩阵的转置 span class token macro property span class token directive hash span span class token directive keyword in
  • cmd找不到conda

    cmd找不到conda以及通过cmd启用Anaconda中的Python环境 xff08 base xff09 1 gt 在系统环境中添加Anaconda路径 在环境变量path中选择新建 xff0c 并将Anaconda安装目录下的Scr
  • 201409-2 画图

    试题编号 xff1a 201409 2 试题名称 xff1a 画图 时间限制 xff1a 1 0s 内存限制 xff1a 256 0MB 问题描述 xff1a 问题描述 在一个定义了直角坐标系的纸上 xff0c 画一个 x1 y1 到 x2
  • sublime 设置识别语言

    cmd 43 shift 输入语言入 object c 自动跳出 Set Syntax Object C 这样就能识别OC的代码片段了 个人觉得用sublime做代码片段管理比较好
  • vsftp local_umask=022 要不很郁闷的!

    先是最基本的配置 请看我的 etc vsftpd vsftpd conf 接受匿名用户 anonymous enable 61 YES 匿名用户login时不询问口令 no anon password 61 YES 接受本地用户 local
  • CSP202112-2序列查询新解java100分

    问题描述 试题编号 xff1a 202112 2试题名称 xff1a 序列查询新解时间限制 xff1a 1 0s内存限制 xff1a 512 0MB问题描述 xff1a 题目背景 上一题 序列查询 中说道 xff1a A 61 A0 A1
  • 【极速下载】gradle各版本快速下载地址大全

    灰机准备好 xff0c 我就是活雷锋 xff0c 持续更新欢迎 收藏 xff0c 若对您有帮助 xff0c 快来 赏个赞 xff01 如果没有你想要的版本 xff0c 可以留言 版本CSDN下载网盘下载更新时间gradle 8 1 1 al
  • 带括号的表达式求值(参考算法笔记)

    虽然算法原理很简单 xff0c 但是有几个地方需要注意 1 因为左括号是要放入操作符栈中的 xff0c 所以他的优先级要设置为0 xff0c 不然其他运算符来了 xff0c 就不知道能不能放进去 2 栈顶运算符优先级小于op时 xff0c
  • AWS部署方式对比和总结

    Hello大家好 xff0c 我们今天的课时对AWS的部署方式做一个对比和总结 部署方式 对于一个专家级解决方案架构师来说 xff0c 需要有在面对不同的业务需求时 xff0c 采用适合的部署方案的能力 我们前面的课时也讲了很多AWS提供的
  • ECS-弹性容器服务 - Part 1

    67 ECS 弹性容器服务 Part 1 Hello大家好 xff0c 我们今天的课时内容是ECS AWS的弹性容器服务 ECS AWS的弹性容器服务 ECS是高度可扩展的 快速的容器管理和编排服务 使用ECS xff0c 能够将您的Doc
  • Centos7上安装MySQL community步骤

    下载mysql80 community release el7 3 noarch rpm软件源包文件 MySQL Community Yum Repository Downloads shell gt sudo yum localinsta