英文:
mysql: [ERROR] unknown variable 'sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE
问题
当我尝试从命令行登录到MySQL时,它给我返回了以下错误消息: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>-
。如何在不登录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'
error
<username>@<username>-
how should i resolved this with out log into MySQL?
答案1
得分: 6
这个问题可以通过进行以下替换来解决:
sql_mode = '[…]'
替换为
sql-mode = ''
也就是说,在大多数情况下,根据问题中指示的值,移除sql-mode指令的值。
STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
根据MySQL 8.0参考手册 > 5.1.11服务器SQL模式 > 设置SQL模式。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论