menu Chancel's blog
rss_feed
Chancel's blog
有善始者实繁,能克终者盖寡。

Linux下安装指定版本的MySQL

作者:Chancel Yang, 创建:2018-10-15, 字数:1291, 已阅:641, 最后更新:2018-10-15

这篇文章更新于 2012 天前,文中部分信息可能失效,请自行甄别无效内容。

在开发中,安装某些指定版本的MySQL是常见的

版本区别

  • MySQL Community Server
    • 社区版本,开源免费,但不提供官方技术支持。
  • MySQL Enterprise Edition
    • 企业版本,需付费,可以试用30天。
  • MySQL Cluster
    • 集群版,开源免费。可将几个MySQL Server封装成一个Server。
  • MySQL Cluster CGE
    • 高级集群版,需付费。
  • MySQL Workbench(GUI TOOL)
    • 一款专为MySQL设计的ER/数据库建模工具。它是著名的数据库设计工具DBDesigner4的继任者。
  • MySQL Workbench OSS
    • MySQL Workbench社区版
  • MySQL Workbench SE
    • MySQL Workbench商用版
  • MySQL Community Server
    • 开源免费的,这也是我们通常用的MySQL的版本。根据不同的操作系统平台细分为多个版本,

从官网下载repo包

  • https://dev.mysql.com/downloads/repo/yum/
  • https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

安装和查看包含哪些MySQL版本

Bash
# 查看版本
rpm -qpl mysql80-community-release-el7-1.noarch.rpm
# 安装MySQL
rpm -ivh mysql80-community-release-el7-1.noarch.rpm

编辑 /etc/yum.repos.d/mysql-community.repo

Bash
sudo vim /etc/yum.repos.d/mysql-community.repo

enabled=0表示禁用版本,enabled=1表示启用指定版本,根据需要自行确认启用什么版本

接着开始安装

Bash
# 查询已经启动跟禁用的版本
sudo yum repolist enabled | grep mysql
# 安装指定版本
sudo yum install mysql-community-server

启动和初始化

Bash
sudo systemctl start mysqld
grep 'temporary password' /var/log/mysqld.log

在部分版本较高的MySQL中如果要设置简单密码,需要降低安全登记

Bash
# 降低安全登记
set global validate_password_policy=0;
# 设置简单密码
alter user root@localhost identified by 'yourpasswd';

[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]