Q. I'm installing WordPress blog system under Debian Linux and getting an error which read as follows:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress
How do I fix this problem under Debian Linux?
A.. First make sure MySQL server is running, type the following command at a shell prompt:
# /etc/init.d/mysql status
If MySQL is not running, enter:
# /etc/init.d/mysql start
If MySQL is not installed, type the following command to install MySQL server:
# apt-get install mysql-server
Make sure MySQL module for php5 is installed:
# dpkg --list | grep php5-mysql
To install php5-mysql module enter:
# apt-get install php5-mysql
Just restart Apache2 web server:
# /etc/init.d/apache2 restart
Now PHP support for MySQL should work without a problem. Also make sure you set localhost or 127.0.0.1 as MySQL hostname while performing wordpress installation.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 23 comments… read them below or add one }
I’m having the same problem trying to install on my localhost in Windows XP environment – any tips on how to fix that? I tried the above and that didn’t work. I’m running Apache 2 and PHP MyAdmin 5.2 (I believe). Everything else works fine and I can create and access MySQL databases in PHP MyAdmin without any issues.
The reason it didn’t work is because this is for a linux environment, not Windows.
Thanks, that did it for me.
Thanks for this, I’ve been trying various “fixes” all night, this did the trick for me. Props!
This was super useful. Thanks for the post.
I am trying to install wordpress under debian.
It is not my first installation, neither the second. It always gone ok.
Not I got the same error pointed out here (you can go to the website). I do have php-server installed and running, I do have php5 installed. I do have the module php5-mysql.
And it still gives me the same error.
Who can help me?
Thanks, Mariana
Sorry I wrote “Not I got the same error ..”, I meant “Now I got the same error..”
And also “I do have php-server installed and running”, I meant “I do have mysql-server installed and running”
Thank you for sharing…
nice post..
Biju Subhash
Thanks for shared but I host on godaddy so How can I do with this problem. My host is shared hosting on Window. Can you show me.
Thanks
Thanks so much!
Followed your process, step by step. Worked like a charm first time!
Thank you so much. I have solved my problem. Thank you again for this useful article…
Thanks i stumbled on the same problem. One would think that the mysql module would be included with PHP5 without asking for it.
Thanks. This was a life saver for my local installation on a Ubuntu Virtual Partition!
So simple and yet such a great help!
Thank you so much :-)
Thank you, this was very handy. Turned out all that was left to do was to restart Apache. Almost felt I could kick myself…
Nice! That fixed my issues…
Thanks, that solved my problem.
This fixed it for me. Gracias!
THANKS THIS WAS A HUGE HELP :D
hehe i just reinstalled my ubunto and updated to version 11.10
i had install the mysql extension but forgot to start it
ty for your help :D
Morning….The blog has been working for YEARS, then all of a sudden this morning I am getting: Your PHP installation appears to be missing the MySQL extension which is required by WordPress.. I’ve read the above but I don’t know what it means. I also can’t access my control panel inside of wordpress anymore. Can someone please give me step-by-step on how to fix this? I need this back up asap. Thank you!
First, these commands need to be typed using a ssh session. Can you access your server using SSH? Are you a server admin? Is your server is managed by a hosting company? Is it on a shared hosting account? If so contact tech support. These commands will only work if you know how to use ssh and login as root user.
Old post I know, but I’m trying to run MySQL 5.1.58 on Ubuntu 12.04, It’s a task I was assigned. I’m also trying to run Apache and PHP5. I compiled MySQL 5.1.58 and apt-get both Apache and PHP5. Everything works great, but when I try to connect PHP and MySQL with php5-mysql, it breaks MySQL.
When I run ./bin/mysqld_safe –user=mysql &, I get an error about /var/lib/mysql for .err, not being there. I tried ln -s to the mysql install location, that fixes that error. When I check the .err file it says:
[ERROR] Can’t find messagefile ‘usr/share/english/errmsg.sys’
[Note] Plugin ‘FEDERATED’ is disabled.
/usr/local/mysql/bin/mysqld: Uknown error 1146
[ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: Initializing buffer pool, size = 8.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Operating system error number 13 in file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: ‘create’.
InnoDB: Cannot continue operation.
mysqld_safe mysqld from pid fiel /var/run/mysqld/mysqld.pid ended
I don’t understand what ‘access rights’ mysqld needs, when I check them, mysql user has ownership of data file in /usr/local/mysql/. Is there something I’m missing/doing wrong? Appreciate any help.
Hi, I need this solution on Windows not Linux. Pls help me!!!