Question

Having issues installing MySQL

I’m using the code sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

And I am getting back this

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package libapache2-mod-auth-mysql
E: Package 'php5-mysql' has no installation candidate```

I'm not sure what to do, I don't have much knowledge about literally anything I'm doing, I'm trying to learn how to set up an image hosting website but I have absolutely no knowledge about any of this, thanks.

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

@sethwaters1999

Since you’re on Ubuntu 16.x, you would need to use PHP 7 packages, which can be found by using:

sudo apt-cache search php7 --names-only

The package name for PHP’s MySQL extension is php7.0-mysql. If you still want PHP 5.x packages you would need to install a repository which offers them or use an older LTS release of Ubuntu (though keep in mind, 16.04 is the latest LTS, thus support for older releases is coming to an end).

The repository in question can be added by running:

sudo add-apt-repository ppa:ondrej/php -y \
&& apt-get update

… then running:

sudo apt-cache search php5 --names-only

You could then install PHP 5.6.x packages.

What about the second error:

E: Unable to locate package libapache2-mod-auth-mysql

How did you fix that.Thanks for sharing!

If you are wanting to install a web server and or even just Mysql a great system to help you with this is VestaCP a free web panel thats installed in only a few commands, it will install apache, nginx, mysql, a mail server and more for you.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel