# Help with converting SQL to mysql



## GhettoBSD (Mar 19, 2010)

Hello!

I am not very familiar with mysql or sql in general... but I would like to convert a sql db to a mysql db. I've searched around and it seems like it's possible.

My question is, is this something that is difficult or fairly easy to do? From my work with mysql it doesn't strike me that it would be hard, but because it is a different db I assume there are probably some things I should know.

What format should I get from the SQL server? My buddy said he can provide the file as a db or a flat file. Or is there something else I should request that would make it easier.

thanks for the help!


----------



## graudeejs (Mar 19, 2010)

SQL is a standard, MySQL implements this standard....
most think should just work(tm)



			
				GhettoBSD said:
			
		

> What format should I get from the SQL server?



I don't have an Idea what you're talking about


----------



## jailed (Mar 19, 2010)

Do you mean Microsoft SQL Server (MSSQL)?

If so, it's easy.

As killasmurf86 said, SQL is a standard language. Not a server etc.


----------



## sim (Mar 19, 2010)

killasmurf86 said:
			
		

> MySQL implements this standard....



Debatable. :\

sim


----------



## jemate18 (Mar 20, 2010)

you might want to convert the database from MSSQL to CSV (comma separated value), then from there, MYSQL can create a database using your CSV file. IT is much easier though if you have a GUI for MySQL.

I recommend WEBYOG's SQLYog community edition.. It will run on freebsd but you have to install WINE first, because SQLYOG is e .exe program


----------



## gilinko (Mar 20, 2010)

Moving data between database servers of different origin(ie: MSSQL -> MySQL) is tricky at best.

First of all, you need a CSV or a SQL syntaxed plain dump of the raw data(ie INSERT statements). Also you will need a dump of the the table layout. Then you will have to test the table layout and change the syntax from the originating server syntax to the target server syntax, as these are to 95% the same but you will have to correct the last 5% by hand.

After the table layout is corrected, and still match the data that is to be inserted, "restore" the data from the data dump file into the database.

But as I said at the beginning. This is somewhat tricky, even if you are an experienced database user.


----------



## GhettoBSD (Mar 20, 2010)

Ooooo, so reply #1 = easy. Comment # 5 hard lol. I like how it got progressively more difficult.

Ok, well at least I know what to expect. I will try my hand at it next week.

And yeah the DB its on now is MS SQl server 2008.

thanks again!!!


----------



## gilinko (Mar 20, 2010)

It should be easy, but as the SQL language isn't implemented exactly the same way in all different database servers and not all of the SQL standard this implemented is where the hard part is. The translation.

Otherwise it would be very easy. Dump the data from the source server in SQL syntax, then import it on the target server. That is the easy part. In an ideal world.

However if it's not a to complicated database(foreign keys etc) then I know it is quite easy as MSSQL is very strict in it's syntax and mysql is more "relaxed" and can handle the import quite good. The other way around is however my worst nightmare(MySQL -> MSSQL).


----------

