SQL Syntax Error During Database Import on Fresh XenForo 2.3.6 Installation

jeetkune

Member
Affected version
2.3.6
Description:
When attempting to import a database backup into a fresh XenForo 2.3.6 installation on a new server, I encounter an SQL syntax error related to the xf_forum table creation. The error occurs specifically around the forum_type_id column definition.

Environment:
  • Source and Target Server: Identical configurations
  • OS: Debian (same version on both servers)
  • Web Server: Nginx (same version)
  • Database: MariaDB (same version)
  • PHP: Same version
  • phpMyAdmin: Same version on both servers
  • XenForo: Clean installation of 2.3.6 (no upgrades)
  • No third-party add-ons installed
  • No Redis or other caching systems configured
Error Details:

ERROR 1064 (42000) at line 4066: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS 64697363757373696f6e,
type_config mediumblob NOT NULL,
moderate_t...' at line 12

Problematic SQL Statement:

sql
CREATE TABLE xf_forum (
...
forum_type_id varbinary(50) NOT NULL DEFAULT x AS 64697363757373696f6e,
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
Steps to Reproduce:

  1. Perform a clean installation of XenForo 2.3.6
  2. Export database from original server using phpMyAdmin (default settings)
  3. Attempt to import the database to new server via:
    • phpMyAdmin interface
    • SSH command line
  4. Error occurs during import
Additional Information:

  • The database export was performed without any modifications to default settings
  • The same error occurs regardless of import method (phpMyAdmin or command line)
  • The hexadecimal value appears to be a representation of the word "discussion" (64697363757373696f6e)
  • This is a fresh installation with no modifications or add-ons
  • Both servers have identical software versions
Expected Behavior:
The database should import successfully without syntax errors, as it was exported from an identical XenForo installation on a server with the same specifications.

Possible Causes:

  1. The DEFAULT value syntax for the varbinary column might be incorrectly formatted in the SQL dump
  2. There might be an issue with how the hexadecimal value is being interpreted during import
  3. The SQL export might be generating invalid syntax for MariaDB despite identical versions
Request:
Please investigate why the database export from a working XenForo installation would generate invalid SQL syntax when imported to an identical environment, and provide guidance on how to properly export/import the database without errors.
 
Back
Top Bottom