rsync to copy some measurement data from one PC to the server.
Is it possible to load the new MyISAM tables without restarting the MySQL server?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Suppose you are moving a MyISAM table with the following characteristics:
You can move it to another folder without disturbing any other DB activity
Here is how
Step01) Create the Target Database on ServerB with this command
CREATE DATABASE mydb;
Step02) Copy the table to the
mydb database on
Run this rsync on ServerA
rsync -av --progress /var/lib/mysql/mydb/mytable.* ServerB:/var/lib/mysql/mydb
That's it. The table should be immediate registered in the information_schema without a restart. To verify that the rsync worked, login to mysql on ServerB and run this:
SELECT COUNT(1) TableExists FROM information_schema.tables WHERE table_schema='mydb' AND table_name='mytable'; SELECT table_rows TableCount1 FROM information_schema.tables WHERE table_schema='mydb' AND table_name='mytable'; SELECT COUNT(1) TableCount2 FROM mydb.mytable;
TableExists is 1 and TableCount1 = TableCount2, CONGRATULATIONS !!!
If you want to double check the rsync, run thi command on both
CHECKSUM TABLE mydb.mytable;
Both checksum values should be identical
Give it a Try !!!