Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I've got PHp installed from my hosting provider and it doesnt seem to have mysql support built in. I was redirected to an installation script:


Which installed mysql as a program, but phpinfo() still shows:

Configure Command './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' .............................. '--without-mysql' '

What do I do next to have mysql support?

share|improve this question
up vote 1 down vote accepted

Install php-mysql:

yum install php-mysql

Then check /etc/php.d/mysql.ini file. Tets php:

php -i | grep -i mysql
MySQL Support => enabled
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib/mysql -lmysqlclient 

php -r 'mysql_connect();'
PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in Command line code on line 1
share|improve this answer
Interesting - this sort of installed something, but no change in phpinfo() and no change in my application - "Installed: php-mysql.x86_64 0:5.1.6-27.el5 Dependency Installed: php-pdo.x86_64 0:5.1.6-27.el5" – siliconpi Oct 16 '10 at 11:40
test php: php -r 'mysql_connect();' – bindbn Oct 16 '10 at 12:18
PHP Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in Command line code on line 1 – siliconpi Oct 16 '10 at 12:35
I dont know if it complicates things, but my root password is X, my mysql admin password is Y and the password for the database user for my applicaiton is Z. – siliconpi Oct 16 '10 at 12:38
@matt_tm - that error means you've got your mysql support working. Otherwise you'd get some version of a "method not found" error. You can sort out the authentication issues in your php code. – Brad Mace Oct 17 '10 at 19:53

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.