Ignoring errors during MySQL import

Posted on 01-05-2018 by Nadir Latif

Source: https://stackoverflow.com/questions/11263018/mysql-ignore-errors-when-importing

While importing large database backups we may come across errors such as duplicate indexes. It would be useful to ignore such minor errors. The mysql command provides the --force switch which allows us to ignore the errors. For example:

sudo mysql -u {mysql_user} -p --force < {sql_file}