I have a large MySQL database, lets call it live_db
, which I want to replicate on the same machine to provide a test system to play around with (test_db
Michaels answer abowe works well but does not copy events, stored procedures or triggers.
To copy those a few more switches is needed for mysqldump:
--events --triggers --routines
To complement an already made copy:
mysqldump --user=username --password=passwd --no-data --no-create-info --no-create-db --events --triggers --routines live_db | mysql --user=username --password=passwd test_db