PDA

View Full Version : remote mysql connection host error



Jamal
11-07-2006, 08:09 AM
mysql_connect(): Can't connect to MySQL server on 'www.myweb.com (10061) in d:\accounts\myweb\db_connect.php

i am getting this error while trying to connect to my sql server host from the php form please help


thanks

Jamal

djr33
11-07-2006, 08:15 AM
Your php code is wrong. Post it. Remove passwords/usernames first, though.

Jamal
11-07-2006, 02:30 PM
<?php

define('DB_USER','xyz');
define('DB_PASS','xyz');
define('DB_HOST','www.my.com');
define('DB_NAME','xyz');



$dbc = mysql_connect(DB_HOST,DB_USER,DB_PASS);

mysql_select_db(DB_NAME);
?>


now tel me wats wrong wid it ?

nikomou
11-07-2006, 08:17 PM
try this:


define('DB_HOST','localhost');

Jamal
11-07-2006, 10:27 PM
yes dude i tried it first, and i think the same: there is a problem with either the url i am typing or with my hosting service, because this code is working fine wen i tried it on my local machine.

need help guys

thetestingsite
11-08-2006, 02:15 AM
if you are trying to access the mysql from outside of the server hosting it, make sure that they/you have it set up to recieve connections from outside sources (non-localhost).

codeexploiter
11-08-2006, 12:12 PM
define('DB_HOST','www.my.com');

Is the above one correct? or its just a spelling mistake

Jamal
11-08-2006, 07:09 PM
thetestingsite : im trying to access my web host's local server.

thetestingsite
11-08-2006, 10:14 PM
thetestingsite : im trying to access my web host's local server.

i figured that, and from the title I figured that you were attempting to connect from an outside source (i.e.: trying to access the hosted mysql server from your home server/computer) As I siad in my previous post, make sure that you/your provider has it set up to accept connections from outside sources. I have had that problem with my linux server, and the solution was to allow connections from all.

boxxertrumps
11-08-2006, 11:21 PM
NEVER accept from everyone unless you got a Username/password system.

Mine is Boxxertrumps & the password is alkatraz.

too bad i wont tell you my domain.... Bwhahahaahaa! i just figured out how to use it too...

thetestingsite
11-09-2006, 03:21 AM
NEVER accept from everyone unless you got a Username/password system.

well thats just common sense (although sense is not that common). I have several different username/password combos just for mysql.