Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Database Development
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-03-2006, 03:08 AM
Junior Member
 
Join Date: Dec 2005
Posts: 4
Default database connection error

Hai

i have two domains. i want to connect the database of one from the other domain. is it possible to do that.

i used the code
$host="www.hostname.com";
$posrt="3306";
$user="username";
$pwd="password";
mysql_connect("$host:$port",$user,$pwd);

but i got an error

Warning: mysql_connect(): Access denied for user: 'username@hostname' (Using password: YES) in /home/public/..

how can resolve the problem.

i created the access host through the cpanel, created username, added the user to that database.

is anything else to do.

thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-08-2007, 08:25 PM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 291
Send a message via MSN to BigAlReturns
Default

If you're still about then yes this can be done. You need to find the IP address of the host you're trying to connect "from" (i.e. the one without the DB). You could do this via reverse ip sites, or cpanel may tell you somewhere. Then go to the cpanel of the site containing the database, go to the database options, and add this IP address to those allowed to access the DB.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with website error mdean Server-Side Scripting 1 12-18-2007 02:19 PM
Parse error MalcolmW Server-Side Scripting 1 03-17-2007 02:25 AM
database image problem robertdh Server-Side Scripting 0 10-08-2006 06:07 AM
formmail.asp giving error in Mozilla Theonyxguy Server-Side Scripting 0 08-24-2005 12:39 AM


All times are GMT -5. The time now is 07:59 PM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.