Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:51:57+00:00 2026-06-04T19:51:57+00:00

I have a network of websites hosted on two different servers, server1 and server2.

  • 0

I have a network of websites hosted on two different servers, server1 and server2.
I need to be able to access the data stored in a MySQL DataBase on server1 from a PHP script in a site hosted on server2.

Say a user registers on site1 on server1 and his data is inserted into the DataBase on server1. Now, that user would be able to log in on site2 on server2 with the same registration.
That would mean the PHP script on server2 needs access to the MySQL DB on server1. I don’t want to copy the user data over to a DB on server2, because the user might also edit his or her user information on site1.

I’d like to be able to share this data without editing the server’s data (as in http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html).
So far, I haven’t been able to figure out a secure way of achieving this, does anyone know how to do this using PHP (or JavaScript, but I’d prefer the system to work for everyone, regardless if JS is enabled)?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:51:59+00:00Added an answer on June 4, 2026 at 7:51 pm

    You can achieve this by allowing your other servers hostname to connect to your database.

    In a MySQL command prompt or phpmyadmin execute the query:

    GRANT ALL ON databasename.* TO username@'ipaddress' IDENTIFIED BY 'somepassword';

    http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a network of blogs that I want to be able to do
I have virtually the same question as https://stackoverflow.com/questions/3300504/finding-out-all-websites-hosted-by-a-webhosting-service ... I'm trying to get shared
I have two websites that will share some resources, lets say, index.php, functions.js and
I have two ASP.NET websites on a web-server, and two SQL Server databases. I
I have developed simple websites and hosted them on shared networks, mainly godaddy. So,
I have successfully hosted my mvc website on server. But I'm not able to
I have a simple silverlight application hosted on a corporate network. However I want
I have an ASP.NET website hosted at home on IIS. Outside my home network
I've installed ArchLinux with VB on MacOS. I have network problems, I cannot resolve
I have a network software which uses UDP to communicate with other instances of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.