开启辅助访问 切换到窄版

centos 7 系统使用yum安装指定mysql数据库版本

[复制链接]
作者:hanhongwen 
版块:
Database Database-Mysql&Mariadb 发布时间:2018-8-13 23:49:32
1470

管理员

积分
6655
QQ
hanhongwen 发表于 2018-8-13 23:49:32 | 显示全部楼层 |阅读模式
1、创建yum的配置文件
# vim /etc/yum.repos.d/mysql-community.repo
  1. [mysql-connectors-community]
  2. name=MySQL Connectors Community
  3. baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
  4. enabled=1
  5. gpgcheck=1
  6. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql

  7. [mysql-tools-community]
  8. name=MySQL Tools Community
  9. baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
  10. enabled=1
  11. gpgcheck=1
  12. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql

  13. # Enable to use MySQL 5.5
  14. [mysql55-community]
  15. name=MySQL 5.5 Community Server
  16. baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/
  17. enabled=1
  18. gpgcheck=1
  19. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql

  20. # Enable to use MySQL 5.6
  21. [mysql56-community]
  22. name=MySQL 5.6 Community Server
  23. baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
  24. enabled=0
  25. gpgcheck=1
  26. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql

  27. # Enable to use MySQL 5.7
  28. [mysql57-community-dmr]
  29. name=MySQL 5.7 Community Server Development Milestone Release
  30. baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
  31. enabled=0
  32. gpgcheck=1
  33. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql

  34. # Enable to use MySQL 8.0
  35. [mysql80-community-dmr]
  36. name=MySQL 8.0 Community Server Development Milestone Release
  37. baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
  38. enabled=0
  39. gpgcheck=1
  40. gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql
复制代码


2、安装Mysql服务,并启动Mysql服务
  1. # yum -y install mysql mysql-serve
  2. # systemctl restart mysqld
  3. # systemctl enable mysqld
复制代码


以上为centos 7 系统使用yum安装指定mysql数据库版本的简单操作步骤,祝你成功

    15561578755
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表