Re: MySQL CONNECTION PROblem
| From: | nabil | Date: | Wed, 11 Jun 2003 06:47:33 +0000 |
| Subject: | Re: MySQL CONNECTION PROblem | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28529@lists.php.net to get a copy of this message | ||
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
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