siddscool19 Posted October 9, 2008 Share Posted October 9, 2008 How to access database on another server? What codings should i use? Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/ Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 Pass the host to the host argument of mysql_connect(). Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-660902 Share on other sites More sharing options...
genericnumber1 Posted October 9, 2008 Share Posted October 9, 2008 just use their host/username/password in your mysql_connect() statement. if they have it firewalled where you can only connect internally, you really can't. Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-660903 Share on other sites More sharing options...
siddscool19 Posted October 9, 2008 Author Share Posted October 9, 2008 I own it myself just the thing is that i want to access my database from another site Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-660905 Share on other sites More sharing options...
genericnumber1 Posted October 9, 2008 Share Posted October 9, 2008 then, as we've said, use the host address in your mysql_connect(). Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-660916 Share on other sites More sharing options...
siddscool19 Posted October 9, 2008 Author Share Posted October 9, 2008 for example my database name is hi_name Username is hi_user Pass is hipass Then how to access database if my database is on http://hii.com I mean can u explain me by this example? Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-661002 Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 mysql_connect('http://hii.com','hi_user','hipass'); You'll also need to make sure mysql allows you to connect from your remote domain. eg; GRANT ALL PRIVILEGES ON *.* TO 'hi_name'@'DOMAIN_YOUR_CONNECTING_FROM' IDENTIFIED BY 'hipass' WITH GRANT OPTION; Link to comment https://forums.phpfreaks.com/topic/127709-access-database-on-another-server/#findComment-661018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.