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.

Download Prestashop Modules for free.

We value friendship. Refer your friends and get points to download for free
Referral Points
PrestaSOO team
Everything you need to make a living doing work you love.
Addons Prestashop
Prestashop Affiliate
Prestashop Email
Convert Whale
Paypal

Discover


It is a wise investment

Prestashop modules we created first to solve the problem of our own business - an eCommerce site. That means they are very useful for a serious business. If you value your web property, these modules are a wise investment.
Sarah Reeves, App Developer @ PrestaSOO
Made with in Paris & Hanoi
PrestaSOO © 2020 // Privacy Policy Terms of Service