I am tring import data from sql file using command line like this:
mysys-12: mysql -u root -p my_db_t < my_db_t_2022_10_12.sql
but I got:
mysql: [ERROR] unknown variable ‘sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTIO
How can I import data? Should I add any params?
2
Answers
Problem solved, I removed sql-mode from client configuration, file: etc/mysql/conf.d/mysql.cnf
Server configuration - No change
It seems that the content in the sql file conflicts with the constraint of sql_mode. There are two methods. The first method is to modify the content of the file to meet the constraint of sql_mode. The second method is to set SQL _ mode =” in mysql. Then import the data and change it back.