LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL and MSSQL together? (https://www.linuxquestions.org/questions/linux-software-2/mysql-and-mssql-together-264398/)

Manuel-H 12-09-2004 06:58 AM

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.

rjlee 12-09-2004 07:43 AM

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.

Manuel-H 12-09-2004 07:46 PM

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"?

rjlee 12-10-2004 10:42 AM

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


All times are GMT -5. The time now is 07:24 AM.