Browsermob/Neustar生成一個MySQLdump文件,您可以使用該文件查詢負載測試數據而不會產生雲小時(自然可計費)。轉儲文件是一個標準的轉儲文件,雖然我明白mysqldump有compatible=mssql option,但我顯然無法自己運行它。使用文本編輯器查看文件內容(這是非常大的)似乎顯示了一系列以大量批量插入結尾的SQL語句。我試圖在Microsoft SQL Management Studio中打開該文件,但由於該文件太大而崩潰(已知錯誤)。將MySQL轉儲文件導入MSSQL
那麼,有沒有人知道一個將MySQL轉儲文件導入MsSQL的工具。我能想到的唯一選擇是安裝MySQL並將轉儲文件導入到該文件中,然後通過ODBC傳輸數據,但是除非需要,否則我真的不想安裝MySQL。
重要提示:所以,爲了清楚起見,我有一個轉儲文件,沒有別的,我無法訪問數據庫,也沒有任何選項重新運行轉儲。我必須處理我已收到的文件。
有什麼建議嗎?該文件看起來像這樣的
第一線:
-- MySQL dump 10.13 Distrib 5.1.58, for debian-linux-gnu (i686)
--
-- Host: localhost Database: collector
-- ------------------------------------------------------
-- Server version 5.1.58-1ubuntu1
/*!40101 SET @[email protected]@CHARACTER_SET_CLIENT */;
/*!40101 SET @[email protected]@CHARACTER_SET_RESULTS */;
/*!40101 SET @[email protected]@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @[email protected]@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @[email protected]@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @[email protected]@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `name_value_pairs`
--
DROP TABLE IF EXISTS `name_value_pairs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `name_value_pairs` (
`id` int(8) unsigned DEFAULT NULL,
`tx_id` char(24) NOT NULL,
`step_id` int(8) unsigned DEFAULT NULL,
`name` varchar(100) NOT NULL,
`value` varchar(100) DEFAULT NULL,
KEY `name_value_pairs_id` (`id`),
KEY `name_value_pairs_tx_id` (`tx_id`),
KEY `name_value_pairs_step_id` (`step_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `name_value_pairs`
--
LOCK TABLES `name_value_pairs` WRITE;
/*!40000 ALTER TABLE `name_value_pairs` DISABLE KEYS */;
/*!40000 ALTER TABLE `name_value_pairs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `object`
--
DROP TABLE IF EXISTS `object`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `object` (
`bytes` int(10) unsigned NOT NULL,
`domain` varchar(255) NOT NULL,
`end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`err_msg` varchar(255) DEFAULT NULL,
`host` varchar(255) NOT NULL,
`method` varchar(16) DEFAULT NULL,
`obj_id` int(8) unsigned NOT NULL,
`obj_num` mediumint(4) unsigned NOT NULL,
`path` varchar(4096) NOT NULL,
`partial_url_md5` varchar(32) NOT NULL,
`protocol` varchar(16) NOT NULL,
`resolved_ip_addr` varchar(255) DEFAULT NULL,
`start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status_code` smallint(4) NOT NULL,
`step_id` int(8) unsigned NOT NULL,
`time_active` mediumint(6) unsigned DEFAULT NULL,
`blocked_time` mediumint(6) unsigned DEFAULT NULL,
`dns_lookup_time` mediumint(6) unsigned DEFAULT NULL,
`connect_time` mediumint(6) unsigned DEFAULT NULL,
`ssl_handshake_time` mediumint(6) unsigned DEFAULT NULL,
`send_time` mediumint(6) unsigned DEFAULT NULL,
`time_to_first_byte` mediumint(6) unsigned DEFAULT NULL,
`receive_time` mediumint(6) unsigned DEFAULT NULL,
`tx_id` char(24) NOT NULL,
`url` varchar(4096) NOT NULL,
KEY `object_partial_url_md5` (`partial_url_md5`),
KEY `object_obj_id` (`obj_id`),
KEY `object_obj_num` (`obj_num`),
KEY `object_step_id` (`step_id`),
KEY `object_tx_id` (`tx_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `object`
--
LOCK TABLES `object` WRITE;
/*!40000 ALTER TABLE `object` DISABLE KEYS */;
然後是批量插入。
你可以使用mysql.exe來導入它,mysql -u username -p -h host databasename
ComputerSaysNo
2012-02-10 14:01:44
@DorinDuminica我沒有安裝MySQL,我試圖避免安裝它。 – Junto 2012-02-15 14:30:58