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?

asked Jul 24, 2021 at 14:53

2 Answers 2

3

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

answered Jul 24, 2021 at 16:30
1
  • 1
    he wrote he tried it already Commented Jul 24, 2021 at 17:38
1

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
answered Jul 24, 2021 at 15:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.