Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
updating db on a different server
Old 03-04-2010, 05:55 PM updating db on a different server
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
I have two servers each with their own MySQL db... I have a form on server 1 that needs to update the table on server 2. Can I use the sql_connect on a script on server 1 to connect to server 2?

Any security issues?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-04-2010, 06:15 PM Re: updating db on a different server
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Assuming you have access to both servers you can send form data on server 1 to the database on server 2. When you're connecting to any database you'll need to provide some information (username, password, database name, and server). When the database is located on the same server as the file connecting to it the server you use to connect is often referred to as localhost. If you want to connect to a database on a different server you'll need to supply the path to that server instead.

I'm not sure if there are any extra security issues to be aware of. Hopefully someone behind me will be able to answer that question.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 03-04-2010, 06:17 PM Re: updating db on a different server
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Theres a few things to make sure you do.

1 - IN your php script, change localhost to teh IP of your other server
2 - On your other server make sur eyour firewall rules ONLY allow your server 1 to connect to it on the MYsql port.
3 - In MYsql itself, Create a LIMITED access account ( select, delete etc ) no drop etc.
4 - in mysql itself, ONLY allow that new user to connect from your remote IP.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 03-05-2010, 12:49 PM Re: updating db on a different server
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
Use GRANT query to create an access from the ip of the server you need to connect from.
http://dev.mysql.com/doc/refman/5.1/...ing-users.html

But note, connecting remotely should degrade speed and responsibility. because it'll have to pass packets through internet to different location instead of using named pipes which is extremely fast compared to internet speed
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 03-09-2010, 12:25 PM Re: updating db on a different server
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
thanks guys... making some valid points I'll be looking at
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to updating db on a different server
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23908 seconds with 12 queries