{question}
How Do I Move Data from MySQL to my SingleStore Cluster?
{question}
{answer}
Moving data from MySQL into SingleStore is a relatively straightforward process as both SingleStore and MySQL utilize the MySQL wire protocol meaning most tools compatible with MySQL will work with SingleStore (barring some considerations).
For this move, we recommend utilizing mysqldump to dump the contents of the schema and data within your MySQL cluster so that you may load it into SingleStore.
For this, we have a page within our docs that describes the process of moving from MySQL to SingleStore.
We recommend reading over this docs page, but simply put:
- You can collect the schema from a database by replacing your database connection info and [database name] within this command:
$ mysqldump -h 127.0.0.1 -u root -B [database name] --no-data -r [database name]_schema.sql
Do this for all databases within your cluster. - You can collect the data from a database by replacing your database connection info and [database name] within this command:
$ mysqldump -h 127.0.0.1 -u root -B [database name] --no-create-info -r data.sql
Again, do this for all databases within your cluster. - You will now have two files for each database: one of the schema DDL and one of the data.
- Load these into SingleStore:
$ mysql -h [HOST] -u [USERNAME] -p [PASSWORD] -P [PORT] < schema.sql
$ mysql -h [HOST] -u [USERNAME] -p [PASSWORD] -P [PORT] < data.sql - Keep in mind that this moves over the data and schema but not the users, roles, groups, stored procedures, or any other data that is not stored directly within user-created databases.
{answer}