LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


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

Rep: Reputation: 30
Mysql problem on CentOS


Hi!
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 :
Code:
rpm -qa | grep mysql
It gives me:
Code:
mysql-server-4.1.20-1.RHEL4.1
mysql-devel-4.1.20-1.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.20-1.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
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) :
Code:
<? phpinfo(); ?>
The server gives me the php info page (http://www.coka.co.yu/proba.php).
But if I want to connect to mysql database, it gives me error.
For example:
Code:
	


    mysql_connect("localhost", "username", "password") 
    or die("Error" . mysql_error()); 
    mysql_select_db("database") 
    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:
Code:
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
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Perhaps you need to install the php-mysql package for your version.
 
Old 07-09-2007, 05:23 AM   #3
rickymaloy
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
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

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:

extensions=mysql.so

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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:38 AM.

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