Scott, Try the following perl script to copy the contents of one mysql table from a mysql database and insert it's contents into another mysql database on a different host/server/computer under the same table name. Essentially a mirrored copy. Can be useful in a cron or a shedule as it wont output any information or anything. Fill in your database details and let it run. Ensure both mysql's are running on each of the hosts and all the accounts and permissions for each database work etc and try it out :)
#!/usr/bin/perl $localuser = "mysql"; $localpass = "mysqlpassword"; $localdatabase = "mydatabase"; $localtable = "products"; $remoteuser = "mysql"; $remotepass = "mysql"; $remotehost = "192.168.1.200"; $remotedatabase = "mirrordatabase"; system ("/usr/local/bin/mysqldump -u $localuser --password=$localpass --add-drop-table $localdatabase $localtable | /usr/local/bin/mysql5:32 PM 4/3/2002--user=$remoteuser --password=$remotepass --host=$remotehost $remotedatabase"); ----- Original Message ----- From: Scott Broderick To: [EMAIL PROTECTED] Sent: Wednesday, April 03, 2002 5:07 PM Subject: How to mirror MySQL database on two servers? Does anyone know of a good place to start looking at how to mirror a MySQL database on two different computers? Any help would be great, Thanks Scott --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php