سؤال
أحاول تثبيت opencart لأول مرة في جهازي المحلي.أنا أستخدم Xampp 1.7.4 PHP 5.3.4 و Windows7 هو نظام التشغيل الخاص بي.أحاول اتباع جميع الخطوات التي تصف هنا .ولكن بعد إعطاء اسم DB، DB اسم المستخدم وكلمة المرور عندما أضغط على "؛ متابعة "زر أنا أحصل على رسالة الخطأ التالية:
المتغير 'sql_mode' لا يمكن ضبطه على قيمة "NO_AUTO_VALUE_ON_ZERO"
أحاول جوجل مع رسالة الخطأ هذه ولكن لا أجد أي شيء.الرجاء مساعدتي .....
المحلول
Remove below line from opencart.sql
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"
you can find opencart.sql file in install folder
Above error comes if different version of mysql is being used.
نصائح أخرى
Change the lines of code from the following files:
install/cli_install.php
Search for
$db->query("SET @@session.sql_mode = 'MYSQL40'");
and replace with$db->query("SET @@session.sql_mode = ''");
install/model/install/install.php
Search for
$db->query("SET @@session.sql_mode = 'MYSQL40'");
and replace with$db->query("SET @@session.sql_mode = ''");
Becouse at this time are 5 results on google regarding to this.... and i didn't found SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO
I had similar problem. My problem was Error 1231,unable to SET SQL_MODE=MYSQL40 . Something like that.
I solved in this way:
go to system/database/mysql.php find line 50 or
trigger_error('Error: ' . mysql_error($this->link) . '<br />Error No: ' . mysql_errno($this->link) . '<br />' . $sql);
exit();
comment the
//exit();
- drop all your tables from database.
- refresh to resend
In this way the code will continue and the cart will be able to finish the configuration.
I hope it helped someone.
PS: I posted this on my website: w3bdeveloper.com
The issue is that "sql_code=MYSQL40" has been deprecated on MySQL since 5.7.22 (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_mysql40)
My solution is similar to @Yogesh Sanger. Instead of setting the sql_code value to an empty string, I just remove the line $db->query("SET @@session.sql_mode = 'MYSQL40'");
For those using Unix, here is a command to remove the culprit
sed -i '/MYSQL40/d' <OpenCart Directory>/install/cli_install.php
sed -i '/MYSQL40/d' <OpenCart Directory>/install/model/install/install.php