Home  |  Linux  | Mysql  | PHP  | XML
From:Nathan Nobbe Date:Sat May 10 23:02:37 2008
Subject:Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
On Sun, May 11, 2008 at 12:42 AM, Rahul <rahul986@gmail.com> wrote:

> Thanks a lot for your reply.
>
> I have tried using
>
> $host = "localhost";
> $db = "dbname";
> $table_main = "tablename";
> $dbusername = "root";
> $dbpass = "passhere";
>
> mysql_connect($host, $dbusername, $dbpass) or die(mysql_error());
>
> and
>
> $host = "mycomputer.webaddress.com";
> $db = "dbname";
> $table_main = "tablename";
> $dbusername = "root";
> $dbpass = "passhere";
>
> mysql_connect($host, $dbusername, $dbpass) or die(mysql_error());
>
> And this mycomputer.webaddress.com works when I use with mysql like this:
>
> mysql -h mycomputer.webaddress.com -u root -p


so, from above (previous post), it looks like the errors youve shown are
actually coming from mysql_query().  what is the result of this (using
credentials from this post and [mycomputer.webaddress.com])

<?php
if(!mysql_connect($host, $dusername, $dbpass)) {
  die(mysql_error());
} else {
  die('successful connection established');
}

-nathan

Navigate in group php.general at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants