Cheer up - I too am having similar problems using Mandrake 8.0. I can run
php files, I have MySql running etc. Hopefully I will try a couple of the
things mention here and see what happens.
-----Original Message-----
From: Chakravarthy K Sannedhi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 05, 2001 5:34 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: MySQL/PHP
--- Steve Suehring <[EMAIL PROTECTED]> wrote:
>
> hmm. Are you sure that MySQL is running? Conversely, does the file
> /var/lib/mysql/mysql.sock exist?
>
> Steve
The mysql server is running and the mysql.sock file exists. Also I am
able to connect to the mysql database by any of the following ways.
mysql -u myname -p mypassword
mysql -u myname -p mypassword -h localhost
But when I try to connect in the following way, it says 'ERROR 1130:
Host 'the.host.name' is not allowed to connect to this MySQL server
mysql -u myname -p mypassword -h the.host.name
That is the reason I specified 'localhost' in the PHP file.
Still the following php file produces those bunch of errors that I
specified earlier.
<html>
<head>
<title>Name List</title>
</head>
<body>
<?php
$db=mysql_connect ("localhost","myname","mypassword");
mysql_select_db ("newone",$db);
$result = mysql_query ("select * from namelist");
printf ("First Name: %s<br>\n", mysql_result($result,
0, "firstname"));
printf ("Last Name: %s<br>\n", mysql_result($result,
0, "lastname"));
?>
</body>
</html>
When I changed the file as below
<html>
<head>
<title>Name List</title>
</head>
<body>
<?php
mysql_connect ("localhost","myname","mypassword");
$database="newone";
@mysql_select_db ("database") or die ("Unable to connect to the
database");
$result = mysql_query ("select * from namelist");
printf ("First Name: %s<br>\n", mysql_result($result, 0, "firstname"));
printf ("Last Name: %s<br>\n", mysql_result($result, 0, "lastname"));
?>
</body>
</html>
For which it gives the following error:
Warning: MySQL Connection Failed: Can't connect to local MySQL server
through socket '/var/lib/mysql/mysql.sock' (111) in
/var/www/html/namelist.php on line 7
Unable to connect to the database
Thanks
Chakravarthy Sannedhi
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php