Re: [PHP] Can't connect php to mysql on linux

2001-02-24 Thread php3

Addressed to: "George  Alexander" <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from "George  Alexander" <[EMAIL PROTECTED]> 24 Feb 2001 
05:40:59 -
>
> Hi,
>
> I working on Redhat Linux 6.1 and I've installed
> MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm.
> MySql is working fine. I've even created a database also using
> MySqlAdmin.
> Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> Apache : apache-1.3.14-2.6.2.i386.rpm.
> I've even installed php-mysql-3.0.16-1.i386.rpm and
> mod-php3-3.0.12-2.i386.rpm.
>
> My problem is I can't connect PHP to Mysql Db using the
> mysyql_connect("localhost","root","mypassword") command.


mypassword is the same password you used for mysqladmin, and the command
line interpreter for the root user, right?


Try this command and see what it returns.  If the error message doesn't
give you a good idea what is wrong, please post again, including the
error message you receive.


mysql_connect( "localhost", "root", "mypassword" ) or
   die( "Unable to connect" . mysql_error());


I suggest you always use this code, along with:

mysql_select_db( "database" ) or
   die( "Unable to select" . mysql_error());

 in every program you write.  It is almost impossible to troubleshoot
problems if you don't know what went wrong.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread David Robley

On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> Hi,
>
> I working on Redhat Linux 6.1 and I've installed
> MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> working fine. I've even created a database also using MySqlAdmin.
> Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
>
> My problem is I can't connect PHP to Mysql Db using the
> mysyql_connect("localhost","root","mypassword") command.
>
> Please help me asap.
> Regards,
> George

Use mysql_error() after your unsuccessful call to mysql_connect to return 
a mysql error string

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread eschmid+sic

On Mon, Feb 26, 2001 at 10:11:02AM +1030, David Robley wrote:
> On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> > Hi,
> >
> > I working on Redhat Linux 6.1 and I've installed
> > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> > working fine. I've even created a database also using MySqlAdmin.
> > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> > Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> > php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
> >
> > My problem is I can't connect PHP to Mysql Db using the
> > mysyql_connect("localhost","root","mypassword") command.
> >
> > Please help me asap.
> > Regards,
> > George
> 
> Use mysql_error() after your unsuccessful call to mysql_connect to return 
> a mysql error string

Hehe, this wouldn't work if the connect was unsuccessful. You can always
get an mysql error string after a successful call to mysql_connect. Look
into Paul DuBois book and it should be very clear.

-Egon

-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
http://www.php-buch.de/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread Miles Thompson

George,

1. Is this a brand new project, or were you connecting before, on your web 
pages? If the latter, what changed?
2. **IMPORTANT**  Have you also run phpinfo() and confirmed that you have 
mysql support installed? **IMPORTANT**
3. Did you stop and restart Apache?
4. Have you tried a minimal page - just connecting and echoing the result? 
or with a built-in die message?
5. Is  this a self-hosted server, or someone elses? What name combinations 
of localhost, username and password have you played with? What name is 
mysql running under?

I'll also confess I've given up on .rpms for all of mysql, apache and php. 
It's fairly quick to build them from source, and you have full control over 
where things are placed. Search for something like "LAMP Apache" and that 
will turn up the necessary tutorials.

This probably hasn't been much direct help, but maybe it'll get you going. 
It's not fun, but I've slowly learned to check basics first! (Like the 
wire, when there's a network connectivity problem - sheepish grin.)

Regards - Miles Thompson


At 10:11 AM 2/26/01 +1030, David Robley wrote:
>On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> > Hi,
> >
> > I working on Redhat Linux 6.1 and I've installed
> > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> > working fine. I've even created a database also using MySqlAdmin.
> > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> > Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> > php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
> >
> > My problem is I can't connect PHP to Mysql Db using the
> > mysyql_connect("localhost","root","mypassword") command.
> >
> > Please help me asap.
> > Regards,
> > George
>
>Use mysql_error() after your unsuccessful call to mysql_connect to return
>a mysql error string
>
>--
>David Robley| WEBMASTER & Mail List Admin
>RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
>AusEinet| http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Can't connect php to mysql on linux

2001-03-01 Thread John Huggins

Also, consider getting PHP 4 on your system.  PHP 3 is old hat.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 11:33 AM
> To: George Alexander; [EMAIL PROTECTED]
> Subject: Re: [PHP] Can't connect php to mysql on linux
> 
> 
> Addressed to: "George  Alexander" <[EMAIL PROTECTED]>
>   [EMAIL PROTECTED]
> 
> ** Reply to note from "George  Alexander" 
> <[EMAIL PROTECTED]> 24 Feb 2001 05:40:59 -
> >   
> > Hi,
> >   
> > I working on Redhat Linux 6.1 and I've installed 
> > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm.
> > MySql is working fine. I've even created a database also using 
> > MySqlAdmin.
> > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for 
> > Apache : apache-1.3.14-2.6.2.i386.rpm.
> > I've even installed php-mysql-3.0.16-1.i386.rpm and 
> > mod-php3-3.0.12-2.i386.rpm.
> >   
> > My problem is I can't connect PHP to Mysql Db using the 
> > mysyql_connect("localhost","root","mypassword") command.
> 
> 
> mypassword is the same password you used for mysqladmin, and the command
> line interpreter for the root user, right?
> 
> 
> Try this command and see what it returns.  If the error message doesn't
> give you a good idea what is wrong, please post again, including the
> error message you receive.
> 
> 
> mysql_connect( "localhost", "root", "mypassword" ) or
>die( "Unable to connect" . mysql_error());
> 
> 
> I suggest you always use this code, along with:
> 
> mysql_select_db( "database" ) or
>die( "Unable to select" . mysql_error());
> 
>  in every program you write.  It is almost impossible to troubleshoot
> problems if you don't know what went wrong.
> 
> 
> 
> 
> Rick Widmer
> Internet Marketing Specialists
> http://www.developersdesk.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]