PHP Classes

PHP MySQL Database Synchronize: Synchronize MySQL databases tables between servers

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 65%Total: 975 All time: 3,722 This week: 52Up
Version License PHP version Categories
mysql-database-synch 1.0Freeware5PHP 5, Databases, Systems administration, W...
Description 

Author

This package can synchronize MySQL databases tables between servers.

One class can retrieve the list tables and records from the origin server MySQL database and send the data to another server script via HTTP.

On the destination server a script receives the request and recreates the origin tables in a MySQL database and inserts the retrieved records.

Picture of Bharat Parmar
  Performance   Level  
Name: Bharat Parmar <contact>
Classes: 11 packages by
Country: India India
Age: 33
All time rank: 51631 in India India
Week rank: 164 Up16 in India India Up
Innovation award
Innovation award
Nominee: 3x

Recommendations

What is the best PHP mysql synchronize database class?
Synchronize an offline MySQL database with the online version

Offline database synchronisation with online database
How to sync offline and online database.

Example

<?php

/*
FILE NAME : example.php
LOCATION : example.php
BASIC DETAILS : This file is the example file for the database synchronization from server1.
AUTHOR : Bharat Parmar
VERSION : 1.0
CREATED DATE : 08-12-2016

*/
@include("class/server1.class.php");
$server1 = new server1();
$output = $server1->getdbupdate();

echo
"<pre>";
print_r($output);
echo
"</pre>";

?>


Details

mysql-database-synchronization-with-php

Synchronize MySQL Database from One Server to Another Server or from One Database to Another Database on the same server using Simple PHP Script.

The source code is available at github. You can either clone the repository or download a zip file of the latest release.

Requirement


1. cURL should be enabled

How To Use

1. copy & paste `server1` directory files on your first server.

2. set database details for the database which you want to synchronize to another database in 
	`includes/config.php` file.

3. copy & paste `server2` directory files on your second server. 

4. set Synchronization URL in `includes/config.php` which should have `server2` directory files. 

5. set database details for the database where you want to synchronize first database data.

6. execute `server1/example.php`

Example


`server1/example.php` (Send Data to server2/example.php)

To make it automatic synchronization on particular interval, you can run the 
server1/example.php as cronjob on specific time.

Output

Array
(
    [data] => Array
        (
            [bh_user_master] => Table Created. 8 Rows Inserted.
            [bh_user_message] => Table Created.
        )

    [status] => success
    [message] => Database synchronization initiated.
)


Array
(
    [data] => []
    [status] => fail
    [message] => No Table Found./Table Structure Not Found./
)

Limitation :

1. This is just for the Development mode only demo. When the script 
	synchronize the database, first it will drop the table on second 
	server and create new table and after that insert all data. 
	During the synchronization time, f the server stopped to respond, 
	the second server database will be truncated. 

2. Synchronization time, table structure and all rows will be 
	synchronization to avoid the collumn/data updation after 
	last synchronization.

Author

Bharat Parmar

Ahmedabad, India.

Mobile : +91 9687766553 Email : bharatparmar383@gmail.com


  Files folder image Files (8)  
File Role Description
Files folder imageserver1 (1 file, 2 directories)
Files folder imageserver2 (1 file, 2 directories)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (8)  /  server1  
File Role Description
Files folder imageclass (1 file)
Files folder imageincludes (1 file)
  Accessible without login Plain text file example.php Example Example script

  Files folder image Files (8)  /  server1  /  class  
File Role Description
  Plain text file server1.class.php Class Class source

  Files folder image Files (8)  /  server1  /  includes  
File Role Description
  Accessible without login Plain text file config.php Aux. Auxiliary script

  Files folder image Files (8)  /  server2  
File Role Description
Files folder imageclass (1 file)
Files folder imageincludes (1 file)
  Accessible without login Plain text file example.php Example Example script

  Files folder image Files (8)  /  server2  /  class  
File Role Description
  Plain text file server2.class.php Class Class source

  Files folder image Files (8)  /  server2  /  includes  
File Role Description
  Accessible without login Plain text file config.php Aux. Auxiliary script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:975
This week:0
All time:3,722
This week:52Up
User Ratings User Comments (1)
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:583
 
Very Good package.
7 years ago (Jack Thomas)
77%StarStarStarStar