Как взять полное резервное копирование mysql базы данных с помощью mysqldump утилиту командной строки

Один из моих любимых - foreach :

for (${iterable_type} ${iterable_element} : ${iterable}) {
    ${cursor}
}

и traceout , так как я часто использую его для отслеживания:

System.out.println("${enclosing_type}.${enclosing_method}()");
]

Я только что подумал о другом и однажды нашел его в Интернете, const :

private static final ${type} ${name} = new ${type} ${cursor};
47
задан Tass 5 March 2013 в 20:54
поделиться

2 ответа

Это немного зависит от вашей версии. До 5.0.13 это невозможно с mysqldump.

На странице руководства mysqldump (v 5.1.30)

 --routines, -R

      Dump stored routines (functions and procedures) from the dumped
      databases. Use of this option requires the SELECT privilege for the
      mysql.proc table. The output generated by using --routines contains
      CREATE PROCEDURE and CREATE FUNCTION statements to re-create the
      routines. However, these statements do not include attributes such
      as the routine creation and modification timestamps. This means that
      when the routines are reloaded, they will be created with the
      timestamps equal to the reload time.
      ...

      This option was added in MySQL 5.0.13. Before that, stored routines
      are not dumped. Routine DEFINER values are not dumped until MySQL
      5.0.20. This means that before 5.0.20, when routines are reloaded,
      they will be created with the definer set to the reloading user. If
      you require routines to be re-created with their original definer,
      dump and load the contents of the mysql.proc table directly as
      described earlier.
16
ответ дан 26 November 2019 в 19:25
поделиться

Используйте '-R' для резервного копирования хранимых процедур, но также имейте в виду, что если вы хотите получить согласованный дамп вашей базы данных во время ее изменения, вам необходимо использовать - single- транзакция (если вы создаете резервную копию только innodb) или - lock-all-tables (если вам также нужны таблицы myisam)

2
ответ дан 26 November 2019 в 19:25
поделиться
Другие вопросы по тегам:

Похожие вопросы: