MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Franck ZAIRE Date:February 11 2004 3:03am
Subject:RE: Connect to MySQL via PHP
View as plain text  
* First check if Mysql is supported by PHP

Create a file test.php with 
<?php
phpinfo();
?>

When opening it on your web server, look for a Mysql section (should have  a
Mysql Section in the PHP configuration)


* If you don't have the Mysql support, you need to recompile PHP with Mysql:

(INSTALL file)

$ cd php-4.x.y
$ ./configure --with-mysql --with-apxs
$ make
$ make install

* check php.ini

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
(...)
;Linux world
;
extension=mysql.so


Hope this will help. If you need more details, not feel free to contact.

Kind regards,
Franck ZAIRE

Tested on Config: RH 9 - PHP 4.3 - Mysql 4.0

-----Original Message-----
From: Ligaya Turmelle [mailto:lig@stripped] 
Sent: 11 February 2004 02:14
To: Eric W. Holzapfel; mysql@stripped
Subject: RE: Connect to MySQL via PHP 

I have never done this but...
Go to your php.ini file and see if changing the [MySQL] mysql.default_host =
is set to the database.

Respectfully,
Ligaya Turmelle

-----Original Message-----
From: Eric W. Holzapfel [mailto:eholz1@stripped]
Sent: Wednesday, February 11, 2004 12:00 PM
To: mysql@stripped
Subject: Connect to MySQL via PHP


Hello Listers,

I have a  problem with my PHP/redhat setup, and possible problem with my
Mysql setup.
I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system.
I have MySql installed on a Slackware linux box.

I want to be able to use Apache/PHP to connect to the mysql database on
the slackware box.
I "think" that PHP is set up ok, which may be  a lie, because PHP says
it does not recognize the commands like -  mysql_pconnect and mysql_connect.

Also if I try to connect to the database using something like this:
 mysql://user,passwrd@slackhost demodb this fails and the "or die
getMessage()" returns
DB: no such database.  (I am trying to use the Pear DB here)

Do I need to have mysql installed on the red hat machine?
I can connect to the slackware linux box from a Windows machine using ODBC.

Any ideas on what I have not done, or what I have done wrong?

eric




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1



Thread
Connect to MySQL via PHPEric W. Holzapfel11 Feb
  • RE: Connect to MySQL via PHPLigaya Turmelle11 Feb
    • RE: Connect to MySQL via PHPFranck ZAIRE11 Feb
  • Re: Connect to MySQL via PHPDon Read11 Feb
    • Re: Connect to MySQL via PHPAdam Goldstein12 Feb
    • Re: Connect to MySQL via PHP with success!Eric W. Holzapfel13 Feb
  • Re: Connect to MySQL via PHPCurtis Maurand11 Feb
Re: Connect to MySQL via PHPMike Miller12 Feb
  • RE: Connect to MySQL via PHPDonny Simonton12 Feb