User registration not working
-
Hi everyone,
I’ve encountered an issue where users are not able to register on our website. After some research and running WordPress in debug mode I’ve found out that this is the issue :
WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO wp_users (user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, display_name, user_login) VALUES ('value', 'value', 'value', '', '2023-05-23 19:13:29', '', 'value', 'value') made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Form_Handler::process_registration, wc_create_new_customer, wp_insert_user
Please note; I have replaced some data with value because of privacy. After getting this error, I started investigating the database and found out that in the table wp_users there is no AUTO_INCREMENT setting at row ID. So this is probably causing this issue. After some more research I also discovered this AUTO_INCREMENT has disappeared when the website was moved in the past (10-04-2022) because that was when the last user was created. The website has been moved on that date and probably made a mistake with not adding the AUTO_INCREMENT on the user ID.
When I tried to activate AUTO_INCREMENT for the row I got the following error:
ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'
I hope someone here knows how this can be fixed.
Thanks!
- The topic ‘User registration not working’ is closed to new replies.