Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 11, 2008 at 12:42 AM, Rahul <rahul986@xxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux