[Techtalk] at wit's end with PHP to MySQL

James james at james-web.net
Wed Jan 30 22:15:16 EST 2002


You usually need a MySQL username and password in the "" after
localhost.

For example:

<?php

	$link_id = mysql_connect("localhost", "mysqluser",
"mypassword");

?>

- James

> -----Original Message-----
> From: techtalk-admin at linuxchix.org 
> [mailto:techtalk-admin at linuxchix.org] On Behalf Of Linda
> Sent: Wednesday, January 30, 2002 8:54 PM
> To: 'Linda'; techtalk at linuxchix.org; James
> Subject: RE: [Techtalk] at wit's end with PHP to MySQL
> 
> 
> Yes, MySQL is running.
> 
> My PHP script is very simple.
> <?php
> 	$link_id = mysql_connect("localhost", "", "");
> ?>
> 
> 
> 
> 
> On 30 Jan 2002, at 20:38, James wrote:
> 
> > Are you sure MySQL is running?  Could you post your PHP script that 
> > you are using to try to connect to MySQL?
> > 
> > - James
> > 
> > > -----Original Message-----
> > > From: techtalk-admin at linuxchix.org
> > > [mailto:techtalk-admin at linuxchix.org] On Behalf Of Linda
> > > Sent: Wednesday, January 30, 2002 8:25 PM
> > > To: techtalk at linuxchix.org
> > > Subject: [Techtalk] at wit's end with PHP to MySQL
> > > 
> > > 
> > > I am new to Linux. Have RH7.0 running on a Thinkpad600.
> > > 
> > > To help me develop PHP scripts, I installed Apache and MySQL
> > > using the RPMs that came with RedHat. I built the PHP RPM from 
> > > source files.
> > > 
> > > Apache and PHP works together, but when I try to use PHP to
> > > connect to MySQL, I get the error message "Can't connect to local 
> > > MySQL server on socket /tmp/mysql.sock"
> > > 
> > > According to phpinfo( ), I have a built of PHP that has MySQL.
> > > 
> > > I have no clue what is wrong. I have tried all the 
> solutions I have
> > > been able to find on the web.
> > > 
> > > Linda
> > > _______________________________________________
> > > Techtalk mailing list
> > > Techtalk at linuxchix.org
> > > http://mailman.linuxchix.org/mailman/listinfo/> techtalk
> > > 
> > 
> 
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org 
> http://mailman.linuxchix.org/mailman/listinfo/> techtalk
> 




More information about the Techtalk mailing list