patternsqlMinor
Connecting SQL Server 2012 to MySQL
Viewed 0 times
2012sqlconnectingmysqlserver
Problem
I have 2 devices, a server computer installed with SQL Server 2012, and a raspberry pi with MySQL installed. I have data in MySQL tables. How can I connect SQL Server 2012 to MySQL so I can save that data?
Solution
One easy way to do this is with HeidiSQL, which can connect to SQL Server and MySQL and is free and open source (https://www.heidisql.com/). Once you set up both connections, you can use the Export Database As SQL feature to transfer data directly between databases.
That should do it.
- In the Session Manager, set up the connection to the MySQL and SQL Server computers
- Connect to the MySQL server, right-click on the server in the browser on the left, and select "Export Database As SQL".
- in the table list, select the table(s) you would like to export
- in the Output: on the right, you will see a list of all servers you have configured in the Session Manager. Select the SQL Server 2012 instance.
- You will probably want to keep the database the same so leave it as [Same as on source server]
- You likely will want to check the create boxes for both database and tables if this is the 1st time you are transferring data
- If you want to transfer the data and not just the table structure, in the Data: dropdown select the option that is best for you. I usually use Delete + insert (truncate existing data), but your needs may be different.
- Click Export in the bottom right
That should do it.
Context
StackExchange Database Administrators Q#200007, answer score: 2
Revisions (0)
No revisions yet.