Restoring huge MySQL dump file to MS SQL Server 2008 - mysql

I have a 19 GB .sql file which is a dump of a MySQL database.
How could I go about mounting that to MS SQL server? Is it just a matter of loading the 19 GB file into management studio and hitting F5?
I don't have access to the original MySQL databases or the server they were running on.
Thank you.

I would go about it like this.
Restore the MySQL databases to a MySQL server.
Setup a linked server from MS SQL to MySQL
Do a SELECT * INTO destinationtable FROM linkedserver.dbo.sourcetable
The only problem here is that you will need to make sure that index definitions etc are recreated.
Youre MySQL backup file will not run in MSSQL without a LOT of work.

Related

.bak file from MYSQL to MS SQL SERVER

I have got a .bak file of mysql database created using Linked server concept, the MYSQL Database has been accessed through SQLServer Instance. I wanted to import that to SQLSERVER 2019 database.
Is it same as a normal restore process or Is there anything I have to be careful about?

Create MySQL database from .mdf and .ldf files from SQL Server 2008

I have some .mdf and .ldf files of database size greater than 10 GB with me.
I want to create a MySQL database using the same.
Is there any provision in MySQL to do it?
Please consider that MySQL and SQL Server 2008 can not be installed on the same machine (or even the same network) in my current setup.
I don't have enterprise edition of SQL Server management studio in our network and will not be able to install it.
Is there any other elegant way to export data from SQL Server 2008 and import it in MySQL?
I don't think it is possible without attaching.
If you find a way how to attach it, you can use some specific migrating tools like this.
Some tools allow to create database specific queries from another solution, that need to be only executed on your side.
The MDF and LDF files belong to Microsoft SQL Server and use Microsoft's own binary format, so you cannot connect these files to other database management systems. The only approach I can think of, is to script out the database code and data from the SQL Server database to a text file (.sql file), and import this file into MySQL.

Import MySQL tables recovered into new MySQL Database

I have the data files of an old MySQL database (.frm, .MID, .MYI), taken from a server hard disk.
No way to be sure about MySQL version: I have no access to the server, I only know the server was a linux machine, built in 2009 or 2010, and then left alone without maintenance.
I downloaded and installed the last MySQL .MSI, but I'm totally new to MySQ.
The first step I need is importing my data into a new MySQL database, and then with a Delphi program I plan to move the data into a SQL Server DB.
How can i import these data tables?
Yo can stop mysql server, create some folder like old_data in mysql data directory, put all your .frm, .MID, .MYI files there and start mysql. After doing so you should be able to see old_data database in results of the SHOW DATABASES command.

Cannot restore backup on SQL Server Express

I have a backup of a SQL database, and it is 409 MB.
When I try to restore it says:
Restore failed for Server 'SPLYF-R3K8G8JL2\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative database size would exceed your licensed limit of 4096 MB per database.
(1) it seems like you are trying to restore a SQL Server 2008 R2 database on an instance of SQL Server 2005. You can't go backwards like that.
(2) SQL Server 2005 Express had a limit of 4GB per database. With 2008 R2, the limit is 10GB.
(Note that the size of the backup file is not necessarily the size of the database. The backup file does not include empty space, so if your MDF is >4GB (and mostly empty) the limitation is still enforced, since the limitation is on data file size, and not on backup size or actual data.)
So, the solution is: install SQL Server 2008 R2 Express Edition, and you should be able to restore your database there (assuming it is < 10GB).
If your data file is currently > 10GB but there is < 10GB of data in it, you can:
in the source instance (or after attaching to a different edition without this limitation), since it seems like there is far less data than 10GB, reduce the data file size using DBCC SHRINKFILE to something less than 10GB.
take another backup
proceed with the attach to Express
Are you sure you are running SQL Server 2008 R2 Express?
Database backups are often compressed: it's not a surprise that this backup would create a database larger than 4 GB, the limit for SQL Server 2008 Express and SQL Server 2005 Express.
Try upgrading to SQL Server 2008 R2 Express.

Import .bak to MySQL (.sql)

I want to import a MS SQL SERVER2008 R2 database backup to MySQL Server. Any help on how I can convert the .bak to a .sql so that it can be imported to a MySQL database server?
I have read other threads regarding this but none have worked so far.
Thank you.
You can restore the database to a local version of SQL Server (you can download the free evaluation edition to do this):
http://msdn.microsoft.com/en-us/evalcenter/ff459612.aspx
Then you can use the import/export wizard in Management Studio to transfer your tables and other objects to your MySQL database (you may need additional ODBC drivers installed locally in order for SQL Server to establish a connection to MySQL).
EDIT
When restoring the database to SQL Server, don't use the clunky UI. Use an actual RESTORE DATABASE command. For example:
RESTORE DATABASE foo FROM DISK = 'c:\path\foo.bak';
Now, you may find that the original database was created with files placed on drives or folders that don't exist locally. So I suggest creating a very simple folder, temporarily, called c:\db_temp\, giving the Everyone account modify privileges, and then running the following:
RESTORE FILELISTONLY FROM DISK = 'c:\path\foo.bak';
This will return a resultset like:
LogicalName PhysicalName
----------- ------------
Foo C:\...\foo.mdf
Foo_log C:\...\foo_log.ldf
You need to build a RESTORE DATABASE command something like the following, based on the result above:
RESTORE DATABASE foo FROM DISK = 'c:\path\foo.bak'
WITH MOVE 'Foo' TO 'c:\db_temp\foo.mdf',
MOVE 'Foo_log' TO 'c:\db_temp\foo_log.ldf';