Post by Capstan » Fri Oct 09, 2020 12:44 am

Installing opencart on a Ubuntu 20 server. I installed mysql, created an opencart user and database, granted the user permissions, and verified that I can log in as that user and do queries. Installed PHP7.3 with no problem. Installed and configured Nginx, unzipped and copied over the opencart files, set ownership, etc. The initial license webpage comes up, the second page shows pre-installation is all green. I enter the database credentials on the configuration page and hit continue, I get an error 500.

Looking in the nginx log I see;
2020/10/08 15:42:39 [error] 677#677: *10 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Error: Variable 'sql_mode' can't be set to the value of 'MYSQL40'<br />Error No: 1231<br />SET @@session.sql_mode = 'MYSQL40' in /var/www/html/(my website).com/system/library/db/mysqli.php:40

Probably some kind of connection problem with the database but not clear how to debug it. I see a statement in mysqli.php;
$this->connection->query("SET SQL_MODE = ''");

Not clear on where this 'MYSQL40' is coming from. When I try executing that command manually I do see an error;
mysql> SET SQL_MODE = 'MYSQL40';
ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'MYSQL40'

What can I try?



Fri Oct 09, 2020 12:26 am

Post by IP_CAM » Fri Oct 09, 2020 6:33 am

Well MySql40 is most likely no longer a valid 'way', to access
and handle an OC v.3.x Database, you'll nedd to use mysqli, to make
it work as planned.

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site:
4'100 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Fri Oct 09, 2020 7:27 am

Already removed from master branch.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Programmer / Opencart Tester

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Capstan » Fri Oct 09, 2020 7:53 am

I found the fix here, I should have done a forum search before posting sorry.
viewtopic.php?f=199&t=218617&p=791484&h ... 40#p791484



Fri Oct 09, 2020 12:26 am
Who is online

Users browsing this forum: No registered users and 4 guests