Sponsored Content
Top Forums Web Development How do you sync tables in mysql between two different servers? Post 302379642 by muay_tb on Friday 11th of December 2009 09:00:09 AM
Old 12-11-2009
Question How do you sync tables in mysql between two different servers?

Hi all,

I have 2 mysql databases running on two different servers (both can be accessed via ssh to each other).

If I have say table ABC on server 1, how can I sync it with table ABC on server 2 if the number of records is different? Both databases are the same structure though server 2 has more tables.

Please can someone suggest an easy way to sync tables between two servers, one local one remote by naming a table and syncing it? I have tried (being dumb) to scp the MYI, MYD and FRM files over to the other server *thinking* this would work....it does to an extent until Mysql complains when you use the scp'd tables as part of a merge Smilie
 

7 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

TODO: Sync User Tables Between Databases

Need to eventually sync the MY.UNIX userdata to the forums database (and others). Suggestions on the best approach welcome. (0 Replies)
Discussion started by: Neo
0 Replies

2. Shell Programming and Scripting

sync files from two different servers.

I have a directory called UNIX 1 which contains 2 files and uploaded into two different servers. Now I want to check whether the directory contains both the files. If not, then need to sync the directory. Please let me know how to do that in shell scripting. (2 Replies)
Discussion started by: madan1
2 Replies

3. UNIX for Advanced & Expert Users

How to Sync two servers

Hi All, want to sync. two servers , both are having solaris os. If am updating any thing in one server , it will automatically sync. with the other server . Is it possible , if so den how ? (3 Replies)
Discussion started by: natraj005
3 Replies

4. Programming

MySQL: Create a relation between two tables.

Hello everybody, I'm having troubles creating a relation between two tables in a MySQL database. Having two tables, being one which contains users information (username, password, user ID, etc) and the other the one which contains transactions information (operation type, user ID of the user who... (2 Replies)
Discussion started by: semash!
2 Replies

5. Programming

MySQL join four tables!

Hello; I want merge four MySQL tables to get the intersection that have a common field for all of them. Join two tables is fine to me, but my this case is different from common situations and there are not very many discussions about it. Can anybody give me some idea? Thanks a lot! Here is part... (8 Replies)
Discussion started by: yifangt
8 Replies

6. Solaris

Client does not sync date with ntp servers

We had a network problem a couple of days before that caused 1 interface to down and up. But today I have noticed that our date is wrong, our system have 4 servers and the other 3 are OK. I used <date> command, the result is: Fri Jan 2 17:57:55 ICT 1970 I have tried set date to be the same as... (3 Replies)
Discussion started by: salvation3103
3 Replies

7. Solaris

Best practise for keeping cronjobs across 2 servers in sync

Hi all, I have 2 server A and B. B is acting as standby for A. The cronjobs running in A must not be run in B until failover. The activation of cronjobs in B can be manual. In server A, I am doing the following 1) create a cron/job script that does "crontab -l >... (5 Replies)
Discussion started by: javanoob
5 Replies
mysqlshow(1)							  MySQL database						      mysqlshow(1)

NAME
mysqlshow - Shows the structure of a mysql database (databases,tables and columns) USAGE
shell> mysqlshow [OPTIONS] [database [table [column]]] SYNOPSIS
mysqlshow [-#|--debug=...] [-?|--help] [-c|--character-sets-dir=...] [-C|--compress] [-h|--host=...] [-i|--status] [-k|--keys] [-p|--password[=...]] [-P|--port=...] [-S|--socket=...] [-u|--user=#] [-V|--version] DESCRIPTION
-#|--debug=... output debug log. Often this is 'd:t:o,filename` -?|--help display help and exit -c|--character-sets-dir=... Directory where character sets are -C|--compress Use compression in server/client protocol -h|--host=... connect to host -i|--status Shows a lot of extra information about each table -k|--keys show keys for table -p|--password[=...] password to use when connecting to server If password is not given it's asked from the tty. -P|--port=... Port number to use for connection -S|--socket=... Socket file to use for connection -u|--user=# user for login if not current user -V|--version output version information and exit NOTE
If last argument contains a shell or SQL wildcard (*,?,% or _) then only what's matched by the wildcard is shown. If no database is given then all matching databases are shown. If no table is given then all matching tables in database are shown If no column is given then all matching columns and columntypes in table are shown SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi- lege_tables(1), mysql_zap(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
Ver 1.0, distribution 4.0.24 Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercur- media.com) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 19 December 2000 mysqlshow(1)
All times are GMT -4. The time now is 04:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy