Jump to content


Photo

mysql connect from another domain


  • Please log in to reply
4 replies to this topic

#1 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 03 June 2006 - 07:34 PM

umm the problem is i cant get it to connect to a db on my other website
<?php
mysql_connect("www.t****g.*******.com", "*****", "******") or
   die("Could not connect: " . mysql_error());
mysql_select_db("tpf");

$result = mysql_query("SELECT thing FROM signup where username = 'desithugg'");
if (!$result) {
   echo 'Could not run query: ' . mysql_error();
   exit;
}
$row = mysql_fetch_row($result);
$thing = $row[0];

if ($thing == "") { $thing = "None"; }

echo $thing;
?>


i think its because i cant get it to grant access to the webiste i used this query
GRANT ALL ON database. * TO '*******'@'www.t****g.******.com' IDENTIFIED BY '*******' 

when i execute that GRANT query it gives me
#1044 - Access denied for user '******'@'localhost' to database 'tpf'
it keeps denying the query but the username and password is right

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 03 June 2006 - 10:42 PM

It's possible you don't have GRANT permissions; is this DB on the same machine?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 04 June 2006 - 01:54 AM

[!--quoteo(post=379755:date=Jun 3 2006, 06:42 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 3 2006, 06:42 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
It's possible you don't have GRANT permissions; is this DB on the same machine?
[/quote]
no they are 2 different websites
1)www.***.byethost32.com
2)www.***.byethost2.com

i wanna connec to the database of site #1 from site #2

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 04 June 2006 - 04:57 PM

It's possible that the host has not permitted non-localhost connctions -- that's why I asked if they were on the same box or not.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 desithugg

desithugg
  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 05 June 2006 - 01:28 AM

[!--quoteo(post=379951:date=Jun 4 2006, 12:57 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 4 2006, 12:57 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
It's possible that the host has not permitted non-localhost connctions -- that's why I asked if they were on the same box or not.
[/quote]

o.o lol you were right my host doesnt permit me to grant permissions to non-localhost




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users