RE: [PHP-DB] MySQL Connect Problem

From: Date: Wed, 16 May 2001 15:47:15 +0000
Subject: RE: [PHP-DB] MySQL Connect Problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9354@lists.php.net to get a copy of this message
Here is sample code: <? $connection = @mysql_connect("localhost", "jeff", "*****") or die("Couldn't connect."); if ($connection) { $msg = "success!"; } ?> This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien > 1. Can you set up a simple connection for us to test out? Allow people from > any host (%) to connect. > 2. Try connecting to your own IP address or host name instead of localhost. > They SHOULD mean the same thing, but I've been able to connect to IP > addresses and not localhost's before when dealing with Windows 2k and mySQL. > It's almost as if my install of mySQL had set up its own name of something > else. Very weird, but its worth a shot. > > -----Original Message----- > From: Jeff Oien [mailto:jeff@webdesigns1.com] > Sent: Tuesday, May 15, 2001 8:24 PM > To: PHP-DB > Subject: RE: [PHP-DB] MySQL Connect Problem > > > Yes they are. > Jeff > > > Is the MySQL and Apache running on the same machine? > > > > Jeff Oien wrote: > > > > > I have MySQL on a new Win2000 install and can't connect to it using PHP. > > > I am able to connect using the command line. I'm not sure what the next > > > step is to troubleshoot. I've checked the username and password in the > > > .ini file using WinMySQLAdmin. I'm using Apache which is working fine > > > otherwise. Typical code: > > > > > > <? > > > $connection = @mysql_connect("localhost", "jeff", > > > "*****") > > > or die("Couldn't connect."); > > > if ($connection) { > > > $msg = "success!"; > > > } > > > ?> > > > > > > Thanks. > > > Jeff Oien > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#9354) next »