0

how are you?

I need to generate a file with all triggers, events, procedures from a server's databases and tried the two commands below

  • mysqldump -u root -p --all-databases --host=127.0.0.1 --no-data --no-create-db --no-create-info --routines --triggers --skip-comments -- skip-opt --default-character-set=utf8 -P3306 > E:\db_objects_no_create.sql

    mysqldump -u root -p --all-databases --host=127.0.0.1 --no-data --no-create-db --routines --triggers --skip-comments --skip-opt --default- character-set=utf8 -P3306 > E:\db_objects.sql

In the first one, the output of the file does not extract the creation codes correctly, they are commented out.

In the second the codes are done correctly however the information of the table creation code is also exported.

Does anyone know how to do this export without the table creation code being generated in the output file?

2 Answers 2

2

Include this:

--no-create-info

It means: "Do not write CREATE TABLE statements that create each dumped table." -- https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html

1
  • 1
    he wrote he tried it already
    – nbk
    Jul 24, 2021 at 17:38
0

to ignore multiple tables, you need to exclude all one by one

Like

mysqldump -u root -p DB_NAME --ignore-table=DB_NAME.table1 --ignore-table=DB_NAME.table3 > database.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.