Re: MySQL CONNECTION PROblem

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

 



but when i used mysql_error()  i got : "sorry database not found"
and i have privileges in mysql/ user table .. as shown below... the point is
if i changed 192.168.0.111 to localhost .. i managed to get the data ...

as my dbconnect.php file includes

<?
mysql_connect("192.168.0.111" , "root" , "password") or die("SORRY CANNOT
CONNECT") ;
mysql_select_db("kt") or die("sorry database not found". mysql_error());
?>

and the user table of mysql database :
#
# Dumping data for table `user`
#

INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'Y', 'N', 'N', 'N');
INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'N', 'N', 'N', 'N');

"George Patterson" <george@visp.com.au> wrote in message
20030611091357.0175a206.george@visp.com.au">news:20030611091357.0175a206.george@visp.com.au...
> On Tue, 10 Jun 2003 16:47:26 +0300
> "nabil" <nabil.attar@aws-syria.com> wrote:
>
> > but when i used mysql_error()  i got : "sorry database not found"
> >
> > as my dbconnect.php file includes
> >
> > <?
> > mysql_connect("192.168.0.111" , "root" , "password") or die("SORRY
> > CANNOT CONNECT") ;
> > mysql_select_db("kt") or
> > die("sorry database not found");
> > ?>
>
> Nabil,
>
> Try changing the last line statement to
> mysql_select_db("kt") or die("sorry database not found". mysql_error());
>
> This will show what the error really is.
>
> Example, You have created the database haven't you??
> Try using the mysql client to connect from the web server to the mysql
> server.
>
> George Patterson



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux