If you get the infamous Error 1062: Duplicate entry #1010
JesperHerrloff
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If you have this error. It is probably caused of Mysql/MariaDB thinks your entity_id which could correctly be 0. But if you try to set insert a row with id 0. The Database handles it lite its null. Therefore the id after which logically will be 1 is already occupied.
There is a solution for this. Open compose.yaml and under DB -> commands add this line
--sql_mode="NO_AUTO_VALUE_ON_ZERO"
This will fix the issue, which I found out today when imported my project in to docker-magento :) As most of you probably is aware of is that customer_group 0 i guests in Magento 1.When you fix the issue with the database being "wrong". You could use bin/mysql -u root and in the cli use
DROP DATABASE magento;
And do not forget about creating it again :)
CREATE DATABASE magento;
If you do like I did you cant use
bin/mysql
, you will have to usebin/bash
and usemysql -h db -u root -p
then give magento as the root password :)Hope this will help someone that makes the same things that I do
Beta Was this translation helpful? Give feedback.
All reactions