Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql: [ERROR] unknown variable 'sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE

Tags:

mysql

When i tried to login to mySql from command line it gives me mysql: [ERROR] unknown variable 'sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' <username>@<username>-error

how should i resolved this with out log into MySQL?

like image 614
brean Avatar asked Aug 05 '26 05:08

brean


1 Answers

This issue can be solved by making the following substitutions:

sql_mode = '[…]'

to be replaced with

sql-mode = ''

that is to say, by removing
the value of sql-mode directive in most cases as
per the value indicated in the question.

STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

according to MySQL 8.0 Reference Manual > 5.1.11 Server SQL Modes > Setting the SQL Mode

like image 90
Resha Elfianur Avatar answered Aug 07 '26 18:08

Resha Elfianur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!