0
我用mysqldump命令做數據庫轉儲。命令我使用:mysqldump跳過評論
$mysqldump -uuser -ppassword --host=1.1.1.1 db_name
--add-drop-database --add-drop-table --skip-compact --no-data
--skip-comments --skip-set-charset --skip-dump-date --skip-tz-utc --tab=path
,並得到結果:
/*!40101 SET @[email protected]@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `action`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `action` (
`id` tinyint(4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET [email protected]_SQL_MODE */;
/*!40111 SET [email protected]_SQL_NOTES */;
但我需要這個轉儲:
DROP TABLE IF EXISTS `action`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `action` (
`id` tinyint(4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
如何刪除這些評論:
/*!40101 SET @[email protected]@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */;
...
/*!40101 SET [email protected]_SQL_MODE */;
/*!40111 SET [email protected]_SQL_NOTES */;
他們不是無用的評論 - DUP http://stackoverflow.com/questions/1916392/how-can-i-擺脫這些評論在一個mysql轉儲 – cDima
我已經閱讀了這個問題和答案。但是,無論如何,我必須刪除這些意見 –
可能的重複:http://stackoverflow.com/questions/1916392/how-can-i-get-rid-of-these-comments-in-a-mysql-dump – MaxU