Bitrix Error: The MySQL sql_mode Variable
This is a common MySQL operating-mode error on 1C-Bitrix websites. The sql_mode setting determines how MySQL behaves and may contain values that are incompatible with 1C-Bitrix.
The Bitrix system check reports:
MySQL operating mode: Error! The MySQL sql_mode variable must be empty; its current value is: ............
How Do You Fix It?
In the left menu, open Content → Site Structure → Files and Folders.
Go to /bitrix/php_interface/.
Open after_connect_d7.php in PHP code editing mode.
Insert these two lines:
Save the file…
Likewise, open after_connect.php in the same directory.
Insert the following line:
Run the system check again.
Back to blog
The Bitrix system check reports:
MySQL operating mode: Error! The MySQL sql_mode variable must be empty; its current value is: ............
How Do You Fix It?
In the left menu, open Content → Site Structure → Files and Folders.
Go to /bitrix/php_interface/.
Open after_connect_d7.php in PHP code editing mode.
Insert these two lines:
$connection = Bitrix\Main\Application::getConnection();
$connection->queryExecute("SET sql_mode=''");
The first line is probably already present…Save the file…
Likewise, open after_connect.php in the same directory.
Insert the following line:
$DB->Query("SET sql_mode=''");
Save the file…Run the system check again.