Import MySQL MyISAM into SQL Server - mysql

Caveat: I have zero experience with MySQL.
I've been given a series of files to do a data conversion and would like to migrate the provided data into SQL Server 2008. The files are:
*.myd
*.myi
*.frm
These file types, as I understand it, are MyISAM. I believe that if I had a running MySQL instance, migrating to SQL Server would be fairly straightforward. I could could either use SQL Server's import wizard or Microsoft SQL Server Migration Assistant for MySQL v1.0. Unfortunately, these files are what I'm stuck with -- I just don't have access to the original MySQL instance.
I also don't presently have MySQL as a running instance locally and I'm not sure if there would be compatibility issues with the files I have.
Can I attach them to MySQL 5.5 with the goal of performing a SQLDump or perhaps to use either tool mentioned above? Am I missing a better way?

Yes, you can easily attach them to MySQL 5.5. Then you can dump the tables using mysqldump (be aware that you will need to either modify dump and remove mysql-specific stuff from the dump, or probably customize mysqldump output - check mysqldump documentation for details). You can also try to link Mysql instance to SQL Server, and then copy tables using SELECT ... INTO [sql_server_table_name] FROM [mysql_table_name].
In any case, the hardest part is to migrate stored procedures/triggers. Mysql and SQL Server have quite a different syntax for them, so you probably cannot automate this process.
Update
Also, I forgot to mention that you will have to modify mysql auto_increment columns to IDENTITY([next_auto_increment_value],1) SQL server.

Related

SSIS linked to a mySQL server

in SQL server it's possible to link a mySQL server into msSQL and query it using SSMS for example. I want to try this and use SSIS to do some transformations and store all the data on this mySQL database.
\I read that there a several ways to link to mySQL into the msSQL server. OLE DB, mySQL ODBC etc etc.
2 questions:
Are there any limitations i might run into when i will use a combination of SSIS and mySQL instead of msSQL?
When i link a mySQL database into msSQL and i write a query in SSMS, do i write the queries in mySQL language or msSQL language. For example the difference in TOP and LIMIT
I have worked with a linked MySQL Server from SQL Server in the past and ran into some issues.
Querying MySQL from SSMS (SQL Server)
Once you have created a linked server you would imagine you should be able to use the four-part name and query the tables in MySQL but it doesnt allow you. for example you cannot do something like...
Select * from MySqlServer.DbName.Schema.TableName
For some reason it throws an error. So the question whether I can use T-SQL in SSMS to query a Linked MySQL Server? Nope, unfortunately not.
But alternatively Microsoft recommends using OPENQUERY to execute queries to a linked server.
When using OPENQUERY, SQL Server does not try to parse the query, it just sends it to the linked server as it is. which means you can/should be able to write MySQL in SSMS using OPENQUERY and it will work.
Using SSIS with MySQL
Even though SSIS is Microsoft's tool that comes with SQL Server but it is a proper ETL tool which can read data from multiple sources and send data to many types of destination.
Once you have used the appropriate driver to connect to MySQL and ported data in SSIS package , its really not relevant anymore, where the data came from? you would have access to all the SSIS tools and you should be able to use them as if the data was coming from a flat file, SQL Server or Excel sheet etc.
By using Linked Server in MSSQL you can also connect to mySql. for that you need to download ODBC drivers. and then you have to create new dsn and while creating dsn you have to insert mySql server's details. then you can further search regarding how to create Linked server on SQL SERVER. This option is very easy and Totally free. You can use OPEN QUERY FOR inserting, updating, deleting and also get the data out from mySQL.

Import a .sql file from MSSQL into MySQL

I have an MSSQL dump file that I want to import into a MySQL database. I attempted doing so via phpMyAdmin and setting the compatibility to MSSQL but that doesn't seem to work. It consistently throws MySQL server has gone away. Upping the max_allowed_packet and wait_timeout didn't do anything to solve that either.
Is there a better way to import this database dump?
Try SQL Server Integration Services (SSIS), an ETL tool (Extract, Transform and Load) which is very much needed for the Data warehousing applications. Also SSIS is used to perform operations like loading the data based on the need, performing different transformations on the data.
Free from MS: http://msdn.microsoft.com/en-us/library/ms143731.aspx
Useful links:
http://www.codeproject.com/Articles/155829/SQL-Server-Integration-Services-SSIS-Part-1-Basics
Assuming you have dealt with all syntax incompatibilities, you can use this:
mysql -u<user> -p < db_backup.sql
If you are just scripting tables and data that should work fine. If you have GO statements in your script remove them, you don't need them for tables and inserts.
If you want to script other objects too you need to review each one as there are significant syntax differences.

MySQL export/import data consistency problem

Currently experiencing an issue whereby I am exporting a MySQL structure and data from a server into a sql file, ready for importing into a local database.
When importing the sql file into a local database, numerous records are changing dramatically. The columns in question tend to be of type bit(1).
The local setup uses the following versions Apache 2.2.17, PHP 5.3.5 and MySQL 5.5.8.
The server is currently using MySQL 5.1.56.
Any ideas what can be done to rectify this scenario?
Try using the --hex-blob parameter with the mysqldump utility when obtaining the sql dump.

Automatically initializing mySQL structures (without mysql shell)

My ISP does not give me access to mysql shell and therefore I'm forced in to a manual import of the initial tables structures.
I can only use : phpMyAdmin and FTP to the SQL Server
Any idea how I could automate this with a PHP script? Apart from the last resort which consists of writing all creation steps one by one in PHP.
Perhaps something like a sql dump interpreter issuing the sql commands does exist ?
Basically you have to create your own interpreter.... quite simple simple actually.

how to import database created in microsoft sql server 2005 to MySql server 5.0

I have created database in microsoft sql server 2005 can i use that particular database in mysql server 5.0 .
There is no common way to perform such kind of migration because of much of differences between these two RDBMS.
The quick suggestion can be: export you MSSQL database into SQL file, open it via favorite text editor, remove MSSQL specific instructions, and load into MySQL using mysql console tool.
This way should be OK for non-complex databases without complex constraints, foreign keys and stored procedures.
Otherwise, you'll need to rewrite these type of database artifacts using MySQL dialect.