can't connect to mysql while offline
Moderator: General Moderators
can't connect to mysql while offline
hello! why can't i connect to my mysql database server while i'm offline? But when i'm connected to the internet, i'm able to connect to it. I use COMPUTERNAME in mysql_connect() method. I have already tried localhost and 127.0.0.1. i also tried appeding the port, 3306. Still nothing when offline. i'm using iis under windows xp pro. Pls help. thanks!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
the error i get when i'm offline:
Warning: mysql_connect(): Access denied for user: 'rivera@127.0.0.1' (Using password: YES) in c:\inetpub\wwwroot\mysql.php on line 15
rivera
But my script runs perfectly fine when i'm online. Here's my script:
<?php
$username="rivera";
$password="rivera";
$database="myfirstdatabase";
mysql_connect("PAUL",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MyFirstTable";
$result=mysql_query($query);
$first=mysql_result($result,0,"name");
printf( $first );
?>
i have a database named myfirstdatabase with a table named myfirsttable. myfirsttable has two columns: name and idnum. thanks!
Warning: mysql_connect(): Access denied for user: 'rivera@127.0.0.1' (Using password: YES) in c:\inetpub\wwwroot\mysql.php on line 15
rivera
But my script runs perfectly fine when i'm online. Here's my script:
<?php
$username="rivera";
$password="rivera";
$database="myfirstdatabase";
mysql_connect("PAUL",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MyFirstTable";
$result=mysql_query($query);
$first=mysql_result($result,0,"name");
printf( $first );
?>
i have a database named myfirstdatabase with a table named myfirsttable. myfirsttable has two columns: name and idnum. thanks!