convert Access to mysql commands - mysql

One of our customer has an Access database in his own server and I need to import it to a linux server with mysql in my own server.
In other words, I need to convert Access to mysql commands (inserts basically).
I've tried the DBWScript which works fine although it does not allow to export only one table. It exports all tables. What I'm doing now is exporting all the tables to a sql file and then I filter it taking only the inserts I really need.
I'd like to know if anybody knows a software like DBWScript that can be run in console-mode and permits to export only one table from a database, because that table has a lot of rows (up to 100.000) and it has no sense to export all the other tables if I am not going to use them. That increases the conversion time a lot.

I finally used a software called "Bullzip MS Access to MySQL" and it works like a charm!
This is the author's website: http://www.bullzip.com/products/a2m/info.php
It allows yo to select the desired table and desired columns in different tables, apart from creating a batch script to automate the process.

You can try Data Import tool in dbForge Studio for SQL Server.
Open Data Import wizard, select MS Access format, specify other options and save template file. Then use this template file (*.dit) in command line mode.

You can try using tips to converting MS Access to MySQL

Related

How to change a MS Acess database into a MySql database or atleast move the data across quickly?

I created a program that stores the scores of a competition into a MS Access database but now I need to change in to use MySql. How can I transfer all the tables and data across?
The easiest way to do this in bulk is to right click on the tables in MS Access and select Export > Text File. This will allow you to save each table as a csv file.
Once you've done that, you can use whatever management program you're using to import the csv files. If you're using MySQL's workbench, this tutorial should help you. If you want to do it manually, this one should help.

export saved MySQL query with database?

I need to export my database, however when I done so and tested it by importing it again in do a different MySQL instance all my bookmarked queries were gone.
How do I export them with the database, so other people can run them by importing the database?
Is there another way?
I could just export each query as a table and have it as separate to the data base
Bookmarked queries have nothing to do with the database. It's a feature of the client. For example that standard linux mysql CLI saves all executed querys to a file name .mysql_history. Like wise whatever client it is that you are using will have a place where this queries are saved, you just need to find it.

How to export data from odbc?

I'm a newbie for odbc. Right now I'm connecting odbc successfully to mysql. Is there any way to easily export datatable to the local? (For me, access is not an option. And I have tried odbc explorer which is good but there's only free trial version. Also I have tried Mysql workbench, which is too dangerous since it can easily wipe out all data in the source.)
Hope to have some suggestions from you guys, cheers.
Most databases I know have some import/export utilites. Such tools exports both schema (tables descriptions, triggers, user functions etc) and data. Of course they are made to work with the same database engine or to move data to newer version of database engine. Mysql have such tools too: look at mysqldump
From ODBC you can obtain some information about schema: table names, column names, column types, primary key etc, and that information should be enough to make simple utility to export data to local files, for example into .csv files. Simply read info about tables using SQLTables(), then for each table do SELECT * FROM table and write result into .csv file.

Importing .sql into MS Access using OBDC

I currently have a database in MySQL, which I'd like to import in MS Access.
Is it possible to do this while keeping all relationships intact (i.e. without exporting to .csv, or by using ODBC)?
I'm a noob in this area so any help is greatly appreciated.
Thanks.
You need to solve two different problems:
Creating an empty MS Access database with a structure that matches the MySQL database structure.
Extracting the data from MySQL and loading it into MS Access.
This is not easy because different SQL databases offer different structural features, different datatypes, and so on. The more complex your use of MySQL is the more likely you'll run into some show-stopper during the conversion (for instance, Access doesn't support triggers at all). Conversely if you're using MySQL as a simple data store you may find the conversion fairly easy.
To get an MS Access database with the same structure as your MySQL database, your best bet is to find a database definition / diagramming tool that offers reverse engineering and supports both MySQL and MS Access. Use it to reverse engineer your MySQL database into a database diagram, then change the underlying database to MS Access and use the tool to generate a database.
Check out Dezign For Databases which (on paper, anyway) offers the features you would need to do this.
To pump the data across, there are any number of tools. This kind of operation is generically referred to as ETL (Extract, Translate, Load).
Do you mean SQL Server? A good starting point might be to check out SQL Server Integration Services (SSIS), which can be used for transferring data around like that.
Google will also be helpful, check out the first result:
http://support.microsoft.com/kb/237980
By the way, you said ".sql" in your question: a .SQL file is a script file, which could do anything from create a database, insert data, drop table, delete data, or given the right permissions, call system procedures and reboot a machine, format a drive, send an email.. Just for ref, .SQL files aren't the storage format used by SQL Server.
While you can script your database's schema into script files via something like SQLyog, you will find that the syntax varies enough from database to database (MySQL to Access, in your case) that you can't directly apply the scripts.
With much effort a conversion script could be created by editing the script (perhaps automated with a program, depending on the resulting script size). I think you would be better served using ODBC to copy the tables (and data) and then extracting and re-applying the relationships from the generated script by hand. Time consuming, but also a one time operation I would hope.
When both systems are the same database, there are tools that can do the comparison and script generation (TOAD for MySQL and RedGate Compare for Microsoft SQL), but they don't do cross database work (at least not the ones I am aware of).
If you create a ODBC DSN, you can use TransferDatabase to import from your MySQL database. You can do it manually with the GET EXTERNAL DATA command (or whatever it is in A2007/A2010) and see how well it works. It won't get all data types exactly right, but you could do some massaging and likely get it closer to what will work best.
Is there some reason you can't just link to the MySQL tables and use them directly? That is, why do you need to import into Access at all?
Access: run query. Just make sure to adapt the SQL code since every RDMS has its own sintaxis (despite SQL being an ANSI standard).

How I do to "migrate" the structure from aspnetdb.mdf to a mysql database

I'm creating a new Asp.Net MVC 3 application. Visual Studio does a lot of the job of create the database and initial layout. Very nice! I will upload that initial files to my server, but I want that it runs using the MySql database on the server.
There's some quick/easy way to do it? I'm not worried about the data, just the structure of the tables, and the connection/configuration changes.
Thank you very much!
You can export any MS-SQL database as a Script (Sql Server manager).
Fix it up to make it compatible.
But you will also need a Membership provider, look around if there exist any for MySql, otherwise you'll have to create one (movie).
There are a number of tools listed in "Migrating from Microsoft SQL Server and Access to MySQL".
Or (assuming that you're using column types that exist on both platforms) you can write a script to convert a schema dump from SqlServer into MySQL (or do the conversion by hand in a text editor). Even better yet, you can write a program program to read the INFORMATION_SCHEMA table from SqlServer and produce the necessary CREATE TABLE... statements in mysql. Lots of options.