Code Monkey home page Code Monkey logo

Comments (4)

wanderleihuttel avatar wanderleihuttel commented on August 20, 2024 1

Hello @AnChEv! I'm not an specialist in MySQL, but I've used the option --compact to not show any comments in the dump. I guess the option --skip-opt force to keep the previous options selected.

Table Version Example 1 (with --disable-keys and --compact):

mysqldump --no-create-info --no-create-db --complete-insert --compatible=postgresql --skip-quote-names --disable-keys --lock-tables --compact --skip-opt --quick -u root bacula Version > Version.sql

##############################################
INSERT INTO Version (VersionId) VALUES (16);
##############################################

Table Version Example 1 (with --disable-keys and without --compact):

mysqldump --no-create-info --no-create-db --complete-insert --compatible=postgresql --skip-quote-names --disable-keys --lock-tables --skip-opt --quick -u root bacula Version > Version.sql

##############################################
-- MySQL dump 10.13  Distrib 5.7.24, for Linux (x86_64)
--
-- Host: localhost    Database: bacula
-- ------------------------------------------------------
-- Server version       5.7.24
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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,POSTGRESQL' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Dumping data for table "Version"
--

INSERT INTO Version (VersionId) VALUES (16);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-11-18 19:57:34
##############################################
````

from bacula-utils.

nchv avatar nchv commented on August 20, 2024

I am not a mysql expert either, so I checked the man page again and it says:

--disable-keys, -K

           For each table, surround the INSERT statements with /*!40000 ALTER TABLE
           tbl_name DISABLE KEYS */; and /*!40000 ALTER TABLE tbl_name ENABLE KEYS */;
           statements. This makes loading the dump file faster because the indexes are
           created after all rows are inserted. This option is effective only for
           nonunique indexes of MyISAM tables.

So it seems those comments have a performance benefit. I don't know if that would benefit the import in PostgreSQL though.

from bacula-utils.

wanderleihuttel avatar wanderleihuttel commented on August 20, 2024

I guess is because the PostgreSQL's index are different from MySQL, and the migration are made using only INSERT commands.

from bacula-utils.

nchv avatar nchv commented on August 20, 2024

from bacula-utils.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.