9

I am trying to install mysql in amazon linux 2 ami and am not able to do it.

sudo yum install mysql56-server -> doesn't work
amazon-linux-extras list -> doesn't list mysql

I do not want mariadb since I have more exposure to mysql (even if both are the same)

  • 1
    MariaDB is drop-in and you will have no real issues switching. – Michael Hampton Jan 28 '18 at 5:21
  • i would prefer mysql because thats what i have been having in my current production – Jey Geethan Jan 28 '18 at 7:26
10

I got the answer myself. Follow the below steps:

sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm 
sudo yum install mysql-community-server
systemctl start mysqld.service

The key is to add the source repo and then install since Amazon Linux 2 doesn't have the default repos in place already.

  • Amazon Linux is fairly poor for repository contents and versions. Ubuntu is generally a better option. – Tim Apr 27 '18 at 4:46
  • I do not agree. – Jey Geethan May 4 '18 at 2:14
  • Can you elaborate Jey ? I know for example that I needed to build Nginx to get a recent version, I had to use an old version of fail2ban, HHVM was difficult (I gave up and used PHP), and in general some of the packages I've tried to use are out of date. Maybe things have improved in the past year or so since I looked, but just about every piece of software supports Ubuntu. – Tim May 4 '18 at 5:35
  • Totally agree Tim. The old AMI was even better than AMI 2. On AMI 2, I had to work to add the Zabbix agent by pretending the machine was RHEL6. Now having trouble just getting a simple mysql-client live without installing the entire MariaDB server with it. Ubuntu 16.04 has better native package support than AMI LInux 2. I am wasting too much time with this version. Back to Ubuntu since Amazon is pushing AMI 2 over old AMI. However, the answer above also works to grab the mysql client so I gave it an upvote for those that want to stick to AMI 2 and just want the client. – Ted Cahall Jul 8 '18 at 20:41
2

Amazon's documentation seems to recommend using MariaDB (a fork of MySQL). To install:

sudo yum -y install mariadb-server
sudo service mariadb start

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.