I'm trying to install MySQL; my command is:

sudo apt-get install mysql-server php-mysql -y

and what I'm getting is an error stating

E: Package 'mysql-server' has no installation candidate

  • 1
    sudo apt install mariadb-client mariadb-server
    – Dougie
    Apr 3, 2020 at 13:41

2 Answers 2


mysql has been replaced by mariadb in Debian10.

Try default-mysql-server - although you can use mariadb.

PS You can see what is available on your distribution e.g.

apt-cache search mysql-server

In recent version of Raspbian MySQL is replaced with MariaDB which is fork of the MySQL and 100% backward compatible with MySQL. To install and setup mariadb follow this tutorial https://geekysunny.com/install-apache-mysql-php-lamp-on-raspberry-pi/

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.