How to import a SQL Server .bak file into MySQL?

前端 未结 10 645
天涯浪人
天涯浪人 2020-12-02 04:52

The title is self explanatory. Is there a way of directly doing such kind of importing?

10条回答
  •  误落风尘
    2020-12-02 05:48

    For those attempting Richard's solution above, here are some additional information that might help navigate common errors:

    1) When running restore filelistonly you may get Operating system error 5(Access is denied). If that's the case, open SQL Server Configuration Manager and change the login for SQLEXPRESS to a user that has local write privileges.

    2) @"This will list the contents of the backup - what you need is the first fields that tell you the logical names" - if your file lists more than two headers you will need to also account for what to do with those files in the RESTORE DATABASE command. If you don't indicate what to do with files beyond the database and the log, the system will apparently try to use the attributes listed in the .bak file. Restoring a file from someone else's environment will produce a 'The path has invalid attributes. It needs to be a directory' (as the path in question doesn't exist on your machine). Simply providing a MOVE statement resolves this problem.

    In my case there was a third FTData type file. The MOVE command I added:

    MOVE 'mydbName_log' TO 'c:\temp\mydbName_data.ldf',
    MOVE 'sysft_...' TO 'c:\temp\other';
    

    in my case I actually had to make a new directory for the third file. Initially I tried to send it to the same folder as the .mdf file but that produced a 'failed to initialize correctly' error on the third FTData file when I executed the restore.

提交回复
热议问题