Report this

What is the reason for this report?

Having issues installing MySQL

Posted on January 3, 2017

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.


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!

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.

@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!

What version of the OS are you using? Sounds like you are using a updated version like Ubuntu 16 where PHP is now version 7 and not version 5.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.