Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Windows I use Xampp. I have tried to install MySQL from the command-line and I can access MySQL through workbench software.

Now if I try to run Wordpress on my computer, I get an error that "Your PHP installation appears to be missing the MySQL extension which is required by WordPress."

Someone help me to install MySQL extension(s) for my installation. If I try to install php-mysql:

 $ sudo apt-get  install php-mysql

then I get this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php-mysql

Please someone help me to install MySQL extension. Most of the blogposts I have seen have this trick, but it's not working for me. The Ubuntu software center shows me that both MySQL server and client are both as installed.

share|improve this question
up vote 8 down vote accepted

The package is called php5-mysql in Ubuntu, not php-mysql.

share|improve this answer
Thanks Dennis, its' work for me. Happy :) – user1978003 Feb 9 '13 at 12:35

Easiest way to install LAMP on Ubuntu is using an APT task:

sudo apt-get install lamp-server^

The caret (^) is not a typo.

It will select all the relevant packages for you. For your specific case is Dennis right, you're just missing the PHP5-MySQL bindings which you were installing with the wrong package name. Anyway, the task will make sure you'll have most common packages, including this one.

share|improve this answer
^ is a caret, not a carrot :-) – Dennis Kaarsemaker Feb 9 '13 at 12:37

If you do not know the exact name of the package you want to install you can run

sudo apt-get update
apt-cache search mysql

This also holds for other packages than mysql. For instance apt-cache search firefox.

Once the options listed, you can select your choice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.