How to fix SQL error to Install Prestashop

When you install Prestashop on a server with Mysql 5.7, you will get an error occured installation process :

"SQL error on query All parts of a PRIMARY KEY must be NOT NULL, if you need NULL in a key, use UNIQUE instead​"

This error will breaks your installation process whether you try to reinstall as many times. Here is the way to fix this problem.

Open your Prestashop-package/install/data/db_structure.sql file :

Prestashop Installation Error

Find

CREATE TABLE `PREFIX_cart_product`
Look below this line and change PRIMARY KEY to UNIQUE

prestashop-install-error.png

Save and exit. That's all. Now you can re-install without any problems.

Get this Advanced Cart Rules module

New module.

Xleft module

Xleft shows customers how much more they need to spend to get free shipping in real time.

Aktualizacja najnowszych modułów!

Age Restriction - 18+ ⊙
Rozwiąż niektóre problemy z wyświetlaniem na urządzeniach przenośnych.


Newsletter Popup v3.2.2
Edycja świąteczna, aby zwiększyć sprzedaż.


Trusty v1.4.7 ⊙
Kompatybilny zarówno z PrestaShop 1.7, jak i PrestaShop 8.

PrestaSOO team
Wszystko, czego potrzebujesz, aby zarabiać na życie wykonując pracę, którą kochasz.

Odkryć

To mądra inwestycja

Moduły PrestaShop, które stworzyliśmy jako pierwsze, aby rozwiązać problem naszego własnego biznesu - strona e-Commerce. Oznacza to, że są bardzo przydatne w poważnym biznesie. Jeśli cenisz swoją usługę internetową, te moduły są mądrą inwestycją.
Sarah Reeves, Programista aplikacji @ PrestaSOO
Wykonane z w Paris i Hanoi
PrestaSOO © 2024. Wszelkie prawa zastrzeżone. // Polityka prywatności Warunki usługi