NovedadPrestaSEO AI+ 2.4.19 — limpieza automática de overrides en conflicto, con copia de seguridad y restauración en un clic · 11 sep 2026
NovedadiConvert Promotions 9.0.4 — corregida la duplicación de reglas de descuento · 8 sep 2026
← Todas las guíasBlog PrestaSOO24 Febrero 2016 · 3 min de lectura

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.