2

I'm trying to install MySQL on a Amazon Linux 2 server and I can't seem to get past this dependency issue (prevents server pkgs etc being installed thus preventing me from starting a mysql-server.

Commands I ran are below:

sudo wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
sudo rpm -Uvh mysql80-community-release-el8-1.noarch.rpm
sudo yum install mysql-server
sudo yum provides */libmysqlclient.so.18
sudo yum install mariadb-libs-5.5.68-1.amzn2.x86_64
sudo systemctl status mysqld
sudo systemctl start mysqld

The following errors I receive when attempting sudo yum install mysql-server and sudo status mysql-server:

sudo yum install mysql-server

sudo systemctl status mysql-server

No clue how to proceed from here, haven't been able to find any helpful resources online, would be very grateful if someone here could help me install and get the MySQL server up and running, as this is something I'm struggling with for work.

Kindest regards.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
newtothis
  • 21
  • 1
  • You are trying to install a CentOS 8 (`el8`) rpm on a CentOS 7 server. That will generally cause issues. – doneal24 Aug 23 '21 at 18:07
  • Well what's weird was that when I (thought) I had wiped all of the 8.1rpm in favour of 7.3, it was finding and installing 8.1 rather than 7.3. Have also tried to hard-delete all existence of 8.1 and still had issues. Can you provide some visibility on how to fully rm all 8.1 artefacts ? – newtothis Aug 23 '21 at 18:21
  • 1
    It's not even a CentOS 7 server. Amazon Linux 2 _forked_ from CentOS years ago, and has diverged so far at this point that many packages are not compatible. Stop here and start over with anything but Amazon Linux (which is not a stable distro). – Michael Hampton Aug 23 '21 at 19:25

1 Answers1

2

Amazon Linux may have been based on Centos in the past, but it's a standalone distro. Don't treat it like Centos or things will go badly. My experience over the years with AL / AL2 is that it's much more difficult to install software and get support, so I don't use it any more except for the simplest use cases. I prefer Ubuntu, the software available and support are MUCH better.

If your server is new and easily replaced I'd discard it and create a new one before going forward. If not you need to roll back the changes you made above before trying again.

If you must use AL2, Amazon has a tutorial for installing MariaDB here. It doesn't use external repos so if that will work for you give it a go.

Otherwise follow an AL2 / MySQL8 tutorial rather than a Centos tutorial. I've found a couple on Google here and here, but I can't vouch for either.

Tim
  • 30,383
  • 6
  • 47
  • 77