How to convert form MSAccess to MySQL?
How to convert form MSAccess to MySQL?
I have to maintain a project that was coded by others. In that project they used MSAccess database (.mdb). I have little knowledge about C# and database connection using C#. Now I need to convert to MySQL from MSAccess.
How can I do that?
Its just one time migration. I just need to convert the application so that it can use mysql database instead of MSAccess.
– Rashad
Mar 23 '14 at 5:59
OK for migration you can one of many available tools these links can be of your help :
http://www.bullzip.com/products/a2m/info.php and https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-export.html Regarding codeing C# with MySQL you require MySql connector (dev.mysql.com/downloads/connector/net) and more help at http://www.codeproject.com/Tips/423233/How-to-Connect-to-MySQL-Using-Csharp– Durgesh Chaudhary
Mar 23 '14 at 6:06
http://www.bullzip.com/products/a2m/info.php
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-export.html
http://www.codeproject.com/Tips/423233/How-to-Connect-to-MySQL-Using-Csharp
Do I need to update all the connection and query too? Or there is a quick way to do this?
– Rashad
Mar 23 '14 at 6:08
I do not know if some tool is available for the same. You need to change every connection (as it has changed), thoroughly test the application and change only queries which are required as per the app behavior. Summarizing it as an answer, please mark the same if it solves your problem.
– Durgesh Chaudhary
Mar 23 '14 at 6:10
3 Answers
3
Your requirement can be broken in two parts:
1.Migrate data : Many tools are available to do the same 2 of the urls being :
2.Update application :
I think you need to perform below steps.
Step 1: Migrate your existing MS ACCESS database to My SQL, you can use MS Access to My SQL tool such as ‘Bullzip’ , you can create temp DB i.e. TempAccessDB
Step 2: Write Script where you need to write insert statements which will migrate your TempAccessDB database to your application’s My SQL database.
Below is an example script for MS SQL(not MySQL)
/********* Transfer Student Table Data ***********
SET @sqlStatement=N'INSERT INTO '+ @newDBName_Full +'Student]
(StudentID,StudentName)
SELECT StudentID,SName
FROM '+@oldDBName_Full +'tblStudent] a
WHERE NOT exists (SELECT 1 FROM '+ @newDBName_Full +'Student] b WHERE LTRIM(RTRIM(b.StudentName))= LTRIM(RTRIM(a.sName)))'
exec sp_executesql @sqlStatement
/********* Transfer Grade Data***********
...
Since you mentioned that it is just a 'one-time' thing, you can do the following...



This will then immediately create the table in your MySql and insert all the records.
Just a note though that it uses utf-8 encoding. For my case, I had Japanese characters in my data and they were converted to something else. Don't know though how to solve this part yet. Apart from that, you should be okay.
No 3rd-party app or coding needed. :D
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Is it a one time activity of migrating the database or complete rework of application in MySQL
– Durgesh Chaudhary
Mar 23 '14 at 5:54