问题描述
我已经使用XAMPP安装了MyBB local,并且运行顺利.但是,当我在服务器上执行此操作时,它会给我错误.
I have installed MyBB local using XAMPP and it goes smoothly. But when I do it on the server it give me errors.
MyBB自己创建并插入了大量数据,我发现错误出在以下查询中:
MyBB creates and inserts a lot of data by itself and I found out the errors are in queries like:
INSERT INTO... VALUES ('NULL', ...)
在我的本地主机MySQL上(两者均为5.5.27)接受这种查询,其中'NULL'作为字符串传递.但是在服务器中,如标题所示,它会显示错误#1366.
On my localhost MySQL (which is 5.5.27 for both) accepts this kind of query, where 'NULL' is passed as a String. But in the server it gives an error #1366 as the title says.
问题在于更改查询不是一个选择,因为它是很多查询,所以任何人都可以将其配置为可以工作的一个主意?
The problem is that changing the query is not an option since it is A LOT of queries, so anyone has an idea where I can configure this to work?
谢谢.
推荐答案
问题是对于MySQL(在这种情况下) 'NULL'
与NULL
不同.
The problem is that for MySQL (in this case) 'NULL'
is not the same as NULL
.
由于该列需要数字数据,因此您的语句不起作用,而以下内容将起作用:
Due to the fact that the column is expecting numeric data your statement does not work while the following would work:
INSERT INTO ... VALUES (NULL, ...)
......也许您可以更改服务器的MySQL模式正在运行.
... maybe you can change the MySQL mode the server is running on.
这篇关于#1366-错误的整数值:第1行的"cid"列为"NULL"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!