skip to Main Content

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


  1. Chosen as BEST ANSWER

    Problem solved, I removed sql-mode from client configuration, file: etc/mysql/conf.d/mysql.cnf

    Server configuration - No change


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search