First of all, we need to make it clear that when navicat exports the database by transferring it to a SQL file, if there are foreign keys, it will cause an error during import, so we need to use data transfer. way to export.
(Learning video sharing: Programming video)
Select to use the file method to save
Advanced options need to be selected as
The exported SQL script is the complete version, and no error will be reported when imported into a new database. .
*If an import error occurs: [Err] 1067 - Invalid default value for 'search_time' The reason for the error means: there is a STRICT mode (strict mode) in mysql5.7 version, and in this mode By default, it is not allowed to set the date value to all 0 values, so if you want to solve this problem, you need to modify the value of sql_mode.
Solution:
mysql> select @@sql_mode; mysql> set sql_mode=(select replace(@@sql_mode,'NO_ZERO_IN_DATE,NO_ZERO_DATE',''));
It is useless to change it here because you need to change the global parameters.
mysql> set @@global.sql_mode=(select replace(@@global.sql_mode,'NO_ZERO_IN_DATE,NO_ZERO_DATE','')); mysql> select @@global.sql_mode;
Just import it again.
Related recommendations: navicat for mysql graphic tutorial
The above is the detailed content of How to export the entire database using navicat. For more information, please follow other related articles on the PHP Chinese website!