Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-16-2007, 03:47 AM   #1
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
Mysql problem on CentOS

I use CentOS 4.4, apache 2.0.52 webserver, php 4.3.9, mysql 4.1.
I have instaled mysql. If I type the command :
rpm -qa | grep mysql
It gives me:
Everithing seems to work fine except mysql. My website (pure php) is already on the apache and work.
For example if I open a page with the content (php info page) :
<? phpinfo(); ?>
The server gives me the php info page (
But if I want to connect to mysql database, it gives me error.
For example:

    mysql_connect("localhost", "username", "password") 
    or die("Error" . mysql_error()); 
    or die("Error" . mysql_error());  
$result=mysql_query("SELECT * FROM table where Name='$name' order by datum DESC") or die("Error:" . mysql_error()); 

$rekord = mysql_fetch_object($result);
echo $record->Column_name;
The error is:
Fatal error: Call to undefined function: mysql_connect()
 in /var/www/html/proba.php on line 4

If I try to connect to mysql database with wrong password, the result is the same.

On the server side mysqld is runing, the database is opened and the mysql port is open.

Can somebody help me?
Old 04-16-2007, 09:53 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Perhaps you need to install the php-mysql package for your version.
Old 07-09-2007, 05:23 AM   #3
LQ Newbie
Registered: May 2007
Posts: 16

Rep: Reputation: 0
additional info pls. because we have the same problem, i tried to installed php-mysql and yet they need some dependencies to be installed. Some of dependencies are conflict with the existing packages. any other idea for this problem?
Old 07-30-2007, 06:34 PM   #4
Registered: Apr 2004
Posts: 686

Rep: Reputation: 46
I am having the same problem. I am using debian and php4. As I understand it, I also need to edit the /etc/php4/apache/php.ini file, and uncomment this line:

I did that, but it's still not working. I also tried stopping and starting apache. Still no luck. If anybody has discovered anything, please let me know.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sound problem on centos galrub Linux - Newbie 1 04-17-2007 11:59 AM
CentOS - X window problem satimis Linux - Distributions 1 03-17-2007 07:31 AM
Problem with yum in CentOS 4.3 combilli Linux - Software 2 10-31-2006 03:39 AM
Upgrading MySQL to 4.1 with YUM on CentOS 3.6? Xoleum Linux - Software 0 12-07-2005 11:01 PM
update centos 4 rc1 to centos 4 trou yum? maxut cAos 2 03-04-2005 02:36 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration