The following walkthrough demonstrates how you would go about backing up one table from a MySQL Database (Schema) on Server A and restoring it to a MySQL Database on Server B.
To collect the data it is a simple mysqldump. From your Windows command line:
C:\Program Files\MySQL\MySQL Workbench 8.0 CE>
Run the command:
mysqldump --column-statistics=0 --user=USERNAME
--password=PASSWORD --host=SOURCE_MYSQL_HOST_FQDN DATABASE TABLE
--result-file=dump.sql
Note: See - Unknown table 'COLUMN_STATISTICS' in information_schema
(1109) - for why I use --column-statistics=0.
To restore the data to MySQL server B:
mysql --user=USERNAME --password=PASSWORD
--host=DEST_MYSQL_HOST_FQDN DATABASE --port 3307 < dump.sql
Note 1: If you’re not using non-standard port, you can skip the --port.
Note 2: You do not need to specify the table.
Comments
Post a Comment