Home > Software engineering >  Export MySQL Database from HeidiSQL to SQL Server. Problem with simple quotes
Export MySQL Database from HeidiSQL to SQL Server. Problem with simple quotes

Time:08-14

I have a remote MySQL DB in a hosting that I need to export to my local SQL Server. I use Heidi SQL to connect the DB and I use the Export to single .sql file The problem is that the DB is 5GB and the .sql file is 2.3GB. So I can't open the .sql with SSMS because it says that the file is to big. So I try to run the command sqlcmd on console >sqlcmd -S localhost\SQLEXPRESS -i "C:\backup\file.sql" but it fails because of the simple quotes:

-- --------------------------------------------------------
-- Host:                         IP
-- Versión del servidor:         5.5.60-0 deb7u1-log - (Debian)
-- SO del servidor:              debian-linux-gnu
-- HeidiSQL Versión:             12.0.0.6468
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE=' 00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE IF NOT EXISTS `MyDB` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `MyDB`;

CREATE TABLE IF NOT EXISTS `Account` (
  `id` char(36) NOT NULL,
  `name` varchar(150) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `created_by` char(36) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`id`)
)

It should not be this extrange quote (``) it should be normal quote (''). Is there a way to generate the .sql script from Heidi with normal quotes so I can execute it in the cmd?? I can't change manually with crt f because I can't open the 2.3GB file

CodePudding user response:

The SQL syntaxes differ between MySQL and SQL Server. When trying to use direct database dump, you will likely have other incompatibilities as well.

Try using the Microsoft SQL Server Migration Assistant for MySQL instead.

  • Related