You can use a client to connect to the TaurusDB instance through an ECS or device that can access the TaurusDB instance and then import the exported SQL files into that instance.
If the source database calls triggers, stored procedures, functions, or events, you must set log_bin_trust_function_creators to ON for the destination database before importing data.
- Import metadata into the TaurusDB instance.
mysql -f -h DB_ADDRESS -P DB_PORT -u root -p < BACKUP_DIR/dump-defs.sql
- DB_ADDRESS indicates the IP address of the TaurusDB instance.
- DB_PORT indicates the port of the TaurusDB instance.
- BACKUP_DIR indicates the directory where dump-defs.sql will be stored.
Example:
mysql -f -h 172.*.*.* -P 3306 -u root -p < dump-defs.sql
Enter password:
- Import data into the TaurusDB instance.
mysql -f -h DB_ADDRESS -P DB_PORT -u root -p < BACKUP_DIR/dump-data.sql
- DB_ADDRESS indicates the IP address of the TaurusDB instance.
- DB_PORT indicates the port of the TaurusDB instance.
- BACKUP_DIR indicates the directory where dump-data.sql will be stored.
Example:
mysql -f -h 172.*.*.* -P 3306 -u root -p < dump-data.sql
Enter password:
- Use the MySQL tool to connect to the TaurusDB instance and view the results.
show databases;
In this example, the database named my_db has been imported.
+--------------------+
| Database |
+--------------------+
| information_schema |
| my_db |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)