# Resetting Database error - Django Series Part 1

**URL:** https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014
**Category:** Django
**Created:** [January 31, 2023, 6:25pm UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014 "2023-01-31T18:25:57Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Vinodh](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@Vinodh](https://forum.codewithmosh.com/u/Vinodh)
#### Post date: [January 31, 2023, 6:25pm UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/1 "2023-01-31T18:25:57Z")

</div>

I followed the below steps after watching the mosh video - Resetting Database error. I tried for 3 days to solve the error but the error didn’t resolve. Please help me.

 ![Resetting Data](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/b/b72b6656951169b9127126322e08d56da972fcde.png)

Steps:

1. Dragged and dropped storefront folder from resources in VS code
2. Changed password in settings.py → Database
3. Run pipenv install in cmd
4. Deleted database storefront in datagrip
5. Created New database storefront in localhost
6. Activated virtual environment - pipenv shell
7. Run python manage.py migrate
8. Refreshed data in datagrip
9. Closed all sessions
10. Dragged and dropped seed.sql file from data in resources
11. Selected schema - storefront. Selected all and executed them all.

---

<div class="post-metadata">

### Author: ![lucidlear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/lucidlear/32/5477_2.png) [@lucidlear](https://forum.codewithmosh.com/u/lucidlear)
#### Post date: [February 1, 2023, 3:06am UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/2 "2023-02-01T03:06:36Z")

</div>

Try closing and reopening vscode / datagrip and/or rebooting your system before running the steps again

If it still doesn’t work you may need to go right back and re-install mysql to make sure everything is installed properly and has correct settings. If your on windows machine be sure to download the community installer [here](https://dev.mysql.com/downloads/installer/)

---

<div class="post-metadata">

### Author: ![Banga](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Banga](https://forum.codewithmosh.com/u/Banga)
#### Post date: [February 2, 2023, 1:36am UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/3 "2023-02-02T01:36:36Z")

</div>

It may be that you already have a product with `PRIMARY_KEY id = 2` in your `store_collection` table.  
I’d suggest jumping into your database and having a look at the data stored in the `store_collection` table.

IF you have data stored with id = 2 just remove it from the table then run the process again.

---

<div class="post-metadata">

### Author: ![tooTALLtim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/tootalltim/32/5469_2.png) [@tooTALLtim](https://forum.codewithmosh.com/u/tooTALLtim)
#### Post date: [February 2, 2023, 3:54am UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/4 "2023-02-02T03:54:43Z")

</div>

Link to previous tries from Vinodh’s last post on the topic, for reference:

> [@Generating Dummy Data Error- Django Series -Part -1](https://forum.codewithmosh.com/t/generating-dummy-data-error-django-series-part-1/17940):
>
> In Django series part 1 - Generating dummy data, I’m getting an error in datagrip(Refer to the image). I downloaded the database from mockaroo as instructed in the video, but when I run the MySQL database, it reports errors. Although there are no email, phone, or membership fields in the database, it generates errors after running in the storefront schema. Can anyone please help me?

---

<div class="post-metadata">

### Author: ![Vinodh](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@Vinodh](https://forum.codewithmosh.com/u/Vinodh)
#### Post date: [February 2, 2023, 7:01pm UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/5 "2023-02-02T19:01:46Z")

</div>

Thank you for all your help. I got it resolved by changing/activating the new django ORM virtual environment in VS code.

---

<div class="post-metadata">

### Author: ![lucidlear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/lucidlear/32/5477_2.png) [@lucidlear](https://forum.codewithmosh.com/u/lucidlear)
#### Post date: [February 2, 2023, 10:59pm UTC](https://forum.codewithmosh.com/t/resetting-database-error-django-series-part-1/18014/6 "2023-02-02T22:59:55Z")

</div>

Great to hear your back on track do let us know if you require further help
