3

I am trying to install MySQL 5.7 community server on CentOS 8, but I can't figure out a way to configure any repo that works.

$ yum repolist all | grep mysql
CentOS-8 - AppStream                            2.2 kB/s | 4.3 kB     00:02    
CentOS-8 - Base                                 2.3 kB/s | 3.9 kB     00:01    
CentOS-8 - Extras                               2.1 kB/s | 1.5 kB     00:00    
CentOS-8 - PowerTools                           7.8 kB/s | 4.3 kB     00:00    

and installing with yum / dnf both give me the same result:

$ sudo dnf install @mysql
Last metadata expiration check: 0:07:30 ago on Tue 03 Dec 2019 02:16:26 AM UTC.
Dependencies resolved.
==============================================================================================================
 Package                              Arch      Version                                  Repository      Size
==============================================================================================================
Installing group/module packages:
 mysql-server                         x86_64    8.0.17-3.module_el8.0.0+181+899d6349     AppStream       22 M
Installing dependencies:
 mariadb-connector-c-config           noarch    3.0.7-1.el8                              AppStream       13 k
 mecab                                x86_64    0.996-1.module_el8.0.0+41+ca30bab6.9     AppStream      397 k
 mysql                                x86_64    8.0.17-3.module_el8.0.0+181+899d6349     AppStream       11 M
 mysql-common                         x86_64    8.0.17-3.module_el8.0.0+181+899d6349     AppStream      143 k
 mysql-errmsg                         x86_64    8.0.17-3.module_el8.0.0+181+899d6349     AppStream      557 k
 protobuf-lite                        x86_64    3.5.0-7.el8                              AppStream      150 k
 libaio                               x86_64    0.3.110-12.el8                           BaseOS          32 k
 numactl-libs                         x86_64    2.0.12-2.el8                             BaseOS          36 k
 policycoreutils-python-utils         noarch    2.8-16.1.el8                             BaseOS         228 k

Is it even possible to install MySQL 5.7 on CentOS 8?

2
  • Found a direct download here: dev.mysql.com/downloads/mysql/5.7.html Dec 3 '19 at 2:58
  • The version that comes in the Centos 8 repos is 8.0. I would advise against using the method in the comment above because those packages are meant for a previous release. Do you just want to use MySQL 5.7 on its own or do you need it for use with something else? Dec 3 '19 at 3:17
5

As mentioned by Tony above, [the accepted answer], here is a step by step guide for how to install mysql 5.7 on centos 8.

Just in case the blog goes down someday, here is the excerpt of all the steps involved

step1: remove mysql default stream

sudo dnf remove @mysql
sudo dnf module reset mysql && sudo dnf module disable mysql

step2: add mysql 5.7 repo

file:

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

content:

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=0

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=0

step3: install as usual

sudo dnf --enablerepo=mysql57-community install mysql-community-server

rest of the steps (password, and secure installation are same with the 5.7 installation)

#start
sudo systemctl enable --now mysqld.service
#read temp password
grep 'A temporary password' /var/log/mysqld.log |tail -1
#secure it
sudo mysql_secure_installation
1

I followed the instructions found here and was able to install MySQL 5.7 on CentOS 8

Install MySQL 5.7 on CentOS 8 / RHEL 8 Linux

[root@mysql01 ~]cat /etc/*release* | grep release
CentOS Linux release 8.0.1905 (Core)

[root@mysql01 ~]# rpm -qi mysql-community-server
Name        : mysql-community-server
Version     : 5.7.29
Release     : 1.el7
Architecture: x86_64
3
  • 1
    Make sure you fully answer the question from the original poster. It seems he was looking more for information on using the appropriate repository rather than simply installing MySQL.
    – Thomas N
    Jan 14 '20 at 23:17
  • Using the instructions linked I added the correct repo to intall MySQL 5.7 utilizing YUM Jan 15 '20 at 1:42
  • Thanks Tony, worked like a charm.
    – user728650
    Jan 15 '20 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.