LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-09-2004, 06:58 AM   #1
Manuel-H
Member
 
Registered: Apr 2003
Location: Singapore
Distribution: Slackware32/64, Ubuntu, Fedora, RHEL
Posts: 138

Rep: Reputation: 15
MySQL and MSSQL together?


Can linux (Slack 10, php 4.3.9, apache 1.3.33, MySQL 4.0.20, MSSQL 2000 on w2k machine) support php with mysql and mssql?

My Objective: php file on the Linux web server to be able to access to 2 different databases (MySQL and MSSQL).

I have recompiled my php with this config.
./configure --with-apxs=/usr/sbin/apxs --enable-versioning --with-mssql=/usr/local/freetds --disable-libxml --with-my
sql=shared,/usr

However, when I view the phpinfo(), I did not see mysql support, only mssql.

I managed to connect to MS SQL 2000 server and view the data.
But when I tried to connect to MySQL, I get error saying no such function "mysql_connect ".

I am able to view the MySQL DB using phpMyAdmin.

Any help or suggestion will be greatly appreciated.
 
Old 12-09-2004, 07:43 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Re: MySQL and MSSQL together?

Quote:
Originally posted by Manuel-H
./configure --with-apxs=/usr/sbin/apxs --enable-versioning --with-mssql=/usr/local/freetds --disable-libxml --with-my
sql=shared,/usr
If you copied and pasted this, then there's your problem; you want --with-mysql (no whitespace between my and sql). Usually, the best thing to do is to run the ./configure script and then look at the output; it will tell you at the end what it's compiling in and what it isn't. The preceeding output tells you how it arrived at those features, with configure.log telling you more detail.

This could be something simple like not having the development packages for mysql installed, or it could be that you need to provide configure with more information, or ensure that versions match.
 
Old 12-09-2004, 07:46 PM   #3
Manuel-H
Member
 
Registered: Apr 2003
Location: Singapore
Distribution: Slackware32/64, Ubuntu, Fedora, RHEL
Posts: 138

Original Poster
Rep: Reputation: 15
MYSQL and MSSQL

The configure statement on my previous messages was actually trucncated when I did a cut and paste.
There was no spaces between "my" and "sql", it was "--with-mysql".

I have checked the config.log and found these two lines.

configure:53086: checking for MSSQL support via FreeTDS
configure:53700: checking for MySQL support

One other questions,

I can only see the mysql.so extension in /usr/lib/php/extensions/
Should I also be getting mssql.so, after compiling it with "--with-mssql"?
 
Old 12-10-2004, 10:42 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
According to the instructions at http://www.php.net/manual/en/ref.mysql.php you need to give the path to mysql to configure using --with-mysql=path

If you have version 5 of PHP (or later) then you also need to install the mysql client library seperately; you may already have it on your system. Look for a file called libmyqlclient (.so or .a I guess) which should be in a directory called lib. The parent directory of that is path in the above. e.g. if you have /usr/lib/libmyqlclient.so then you want to use --with-mysql=/usr
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a MSSQL-to-MySQL gateway? Billhead Linux - Software 0 10-29-2004 12:51 AM
MySQL to MSSQL zak3 Programming 1 01-22-2004 02:16 AM
PHP and MSSQL BBPS Linux - Software 2 10-10-2003 10:36 AM
Perl / MSSQL edbravo Programming 1 02-14-2002 04:57 AM
Perl/mssql edbravo Linux - Newbie 0 02-13-2002 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:26 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