# Changing the starting value for AUTO\_INCREMENT on wp\_users table

**URL:** <https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237>\
**Category:** Support\
**Tags:** database\
**Created:** [July 25, 2023, 11:17am UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237 "2023-07-25T11:17:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![krackedkreative](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/krackedkreative/32/18687_2.png) [@krackedkreative](https://community.localwp.com/u/krackedkreative)\
**Post date:** [July 25, 2023, 11:17am UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/1 "2023-07-25T11:17:52Z")

</div>

### What issue or error are you experiencing?

Hey guys, I typically run the _ALTER TABLE wp\_users AUTO\_INCREMENT =_ SQL Query to set a custom starting value for new User ID#'s. I’ve run hundreds of these queries in a previous Desktop Server environment with phpMyAdmin and no issues.

I just tried it on a handful of new site builds with Adminer and getting an error =\> “Error in query (1067): Invalid default value for ‘user\_registered’”.

Could somebody please let me know what I’m missing?

Kind regards,  
Paul

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [July 25, 2023, 2:59pm UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/2 "2023-07-25T14:59:37Z")

</div>

Hi @krackedkreative

This might be helpful:

> <https://stackoverflow.com/questions/62663791/my-sql-said-1067-invalid-default-value-for-user-registered>

---

<div class="post-metadata">

**Author:** ![krackedkreative](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/krackedkreative/32/18687_2.png) [@krackedkreative](https://community.localwp.com/u/krackedkreative)\
**Post date:** [July 26, 2023, 10:24am UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/3 "2023-07-26T10:24:39Z")

</div>

Thanks Nick, unfortunately setting the sql\_mode globally using -

set global sql\_mode ='ONLY\_FULL\_GROUP\_BY,STRICT\_TRANS\_TABLES,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_ENGINE\_SUBSTITUTION’;

doesn’t work…

It does enable you to run the query ALTER TABLE wp\_users AUTO\_INCREMENT = ‘integer of choice’ without throwing a SQL error.

However, removing 'NO\_ZERO\_IN\_DATE,NO\_ZERO\_DATE’from the global sql\_mode caused other issues, including locking me out of all of my sites WP Admin.

> For anyone else following this thread =\>
> 
> Running set global sql\_mode ='ONLY\_FULL\_GROUP\_BY,STRICT\_TRANS\_TABLES,NO\_ZERO\_IN\_DATE,NO\_ZERO\_DATE,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_ENGINE\_SUBSTITUTION’
> 
> In an effort to restore the DB to it’s original values; failed.

I ended up binning the app for the third time this month and reinstalling a fresh instance of Local…

Kind regards,

Paul

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [July 28, 2023, 4:26pm UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/4 "2023-07-28T16:26:36Z")

</div>

Did reinstalling the app resolve the issue?

---

<div class="post-metadata">

**Author:** ![krackedkreative](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/krackedkreative/32/18687_2.png) [@krackedkreative](https://community.localwp.com/u/krackedkreative)\
**Post date:** [July 28, 2023, 10:42pm UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/5 "2023-07-28T22:42:09Z")

</div>

Hey Nick, reinstalling the app appears to have given me a clean slate again. However I binned all of the DBs from my existing site installations and installed fresh ‘blank’ DBs before importing them into Local; just to be sure…

I don’t believe that this is a Local issue, rather a “newer version” of SQL issue, than I was using with DesktopServer. I ran some queries to change User ID#s; no problem, but setting the auto-increment using that particular query doesn’t work. Further research hasn’t uncovered any definitive solutions yet…

Regards,  
Paul

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [July 29, 2023, 12:58pm UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/6 "2023-07-29T12:58:48Z")

</div>

Thank you for following up and sharing your findings with the community. We appreciate all your attention to detail. If you have any other questions or concerns don’t hesitate to reach back out. We are always happy to help!

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [October 27, 2023, 12:59pm UTC](https://community.localwp.com/t/changing-the-starting-value-for-auto-increment-on-wp-users-table/38237/7 "2023-10-27T12:59:42Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
