XF 2.2 can't be set to the value of 'NULL'

Scandal

Well-known member
Code:
ERROR 1231 (42000) at line 12428 in file: 'c:\is.sql': Variable 'time_zone' can't be set to the value of 'NULL'
ERROR 1231 (42000) at line 12430 in file: 'c:\is.sql': Variable 'sql_mode' can't be set to the value of 'NULL'
ERROR 1231 (42000) at line 12431 in file: 'c:\is.sql': Variable 'foreign_key_checks' can't be set to the value of 'NULL'
ERROR 1231 (42000) at line 12432 in file: 'c:\is.sql': Variable 'unique_checks' can't be set to the value of 'NULL'
ERROR 1231 (42000) at line 12433 in file: 'c:\is.sql': Variable 'character_set_client' can't be set to the value of 'NULL'
Query OK, 0 rows affected (0.000 sec)

ERROR 1231 (42000) at line 12435 in file: 'c:\is.sql': Variable 'collation_connection' can't be set to the value of 'NULL'
ERROR 1231 (42000) at line 12436 in file: 'c:\is.sql': Variable 'sql_notes' can't be set to the value of 'NULL'
MariaDB [isxf22]>
The above errors appear ~at the end of an import (sql file) via XAMPP mysql command line.

Any idea how to fix it?
Maybe to edit via phpmyadmin the relevant db table to apply NULL as default for those columns, then re-export and then re-import?
 
Maybe to edit via phpmyadmin the relevant db table to apply NULL as default for those columns, then re-export and then re-import?
It looks the SQL file doesn't have CREATE TABLE, and you are trying to import into an existing table. However, the real table should be accepting NULL values for those fields, because it has records which contain NULL values.

Therefore, yes, you need to set those columns NULL as default in the target database table and re-import. No need to re-export in this case.

Or, the better solution unless you have existing data in the imported tables and trying to append new data, re-export by also including the table structure beside data. Note that it will delete the existing and matching tables in the target database.
 
That was an issue after a new, clean installation of XAMPP for Windows 10.
I was able to fix it, by adding this line on my.ini:
default-time-zone = "+00:00"
(below [mysqld])

... and change both:
max_allowed_packet

..to something like 128M

:)
 
Oh, it says "Variable" in the errors! My comment is completely irrelevant as I misread the errors.

Glad you solved it.
 
Top Bottom