0

I installed mysql on my ubuntu apache2 aws ec2 server

I ran the following command to install

 sudo apt-get install mysql-server-5.6

Now when i type in mysql -V i get the below output

mysql  Ver 14.14 Distrib 5.6.35, for debian-linux-gnu (x86_64) using  EditLine wrapper

when I type in service mysql status I get

 mysql.service
 Loaded: not-found (Reason: No such file or directory)
 Active: inactive (dead)

However if i try to start mysql I get an error sudo /etc/init.d/mysql restart

sudo: /etc/init.d/mysql: command not found

so I am not sure how to resolve this?

It also fails if I do sudo service mysql restart

Failed to restart mysql.service: Unit mysql.service not found.

Ubuntu Version Ubuntu 16.04.5 LTS Also I know mysql 5.6 is not the newest version but I need to use it on the server.

When I run dpkg -l | grep mysql I get

ii  libdbd-mysql-perl                4.033-1ubuntu0.1   
libmysqlclient20:amd64           5.7.23-0ubuntu0.16.04.1  
mysql-client-5.6                 5.6.35-1+deb.sury.org~xenial+0.1 
mysql-client-core-5.6            5.6.35-1+deb.sury.org~xenial+0.1  
mysql-common                     5.7.23-0ubuntu0.16.04.1
mysql-server-core-5.6            5.6.35-1+deb.sury.org~xenial+0.1 
  • Does 16.04 use systemd ? – Iain Aug 3 '18 at 20:45
  • @Iain Yes, but at that early (for Ubuntu) stage a lot of services still had old-style upstart scripts. But I think something else is going on here. – Michael Hampton Aug 3 '18 at 20:47
  • I think its because my mysql-common is still showing 5.7.23 i had 5.7 installed but had/am trying to downgrade – Jay Aug 3 '18 at 20:54
  • the service name is probably mysqld.service – danblack Aug 19 '18 at 0:22

Your Answer

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

Browse other questions tagged or ask your own question.