3

I'm running an AWS Linux 2 AMI and installed mariadb. The packages installed are:

yum list | grep maria

But when I try to start the service running

sudo systemctl start mariadb

I get

Failed to start mariadb.service: Unit not found.

Any hints?

xain
  • 677
  • 3
  • 13
  • 24
  • I think the service is spelled "mysql", not "mariadb". – Rick James Aug 21 '19 at 17:28
  • Tried that first and nope. Neither mysql nor mariadb show when running "sudo systemctl list-unit-files" – xain Aug 21 '19 at 19:41
  • I can't reproduce this. Try a fresh Amazon Linux 2 instance. – Michael Hampton Aug 22 '19 at 01:54
  • In your listing, the only thing that's `installed` is `mariadb-libs`. All other packages are shown as availabl on the Amazon repository. – Jenny D Aug 23 '19 at 10:11
  • (also, in the future, please do not take a screenshot of a terminal window. Instead, copy/paste the actual text, using the code formatting option (looks like `{}`).) – Jenny D Aug 23 '19 at 10:12

2 Answers2

2

Finally it worked after explicitly running yum install mariadb-server

xain
  • 677
  • 3
  • 13
  • 24
1

You need to enable the service first, as it comes disabled:

systemctl enable mariadb

Then you can start it normally:

systemctl start mariadb
  • Doesn't work for mariadb nor mysql – xain Aug 22 '19 at 00:53
  • What do you see when you try to enable mariadb? Try "rpm -qf /usr/lib/systemd/system/mariadb.service". Do you get the following as result? "mariadb-server-5.5.62-1.amzn2.0.1.x86_64" If so, what's your partitioning scheme? Maybe you are hitting https://github.com/systemd/systemd/issues/8307 – Julio González Gil Aug 22 '19 at 01:11
  • I get "error: file /usr/lib/systemd/system/mariadb.service: No such file or directory" – xain Aug 22 '19 at 02:00