@IfNewSdaf

Как заставить пропускать mysql ошибки при импорте?

Суть в том что при импорте из дампа .sql возникает ошибка в синтаксисе внутри файла и заливка в базу останавливается. Так вот, как сделать так чтобы при заливке дампа в базу ошибки просто игнорировались и проблемные места пропускались, а импорт шел дальше?
  • Вопрос задан
  • 2138 просмотров
Решения вопроса 1
@bkosun
Используйте флаг --force, -f

--force, -f

Ignore all errors; continue even if an SQL error occurs during a table dump.

One use for this option is to cause mysqldump to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped. Without --force, mysqldump exits with an error message. With --force, mysqldump prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing.

If the --ignore-error option is also given to ignore specific errors, --force takes precedence.


https://dev.mysql.com/doc/refman/8.0/en/mysqldump....
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы