user created via SQL can't log in to dashboard
-
I migrated a WP install to a new server. Somehow the wp_usermeta and wp_users tables disappeared. I re-created the tables, and used the SQL query below to create a new admin user. Now, the user can log in but can’t access the dashboard, erroring:
You do not have sufficient permissions to access this page.
What do I need to do to give the user access to the dashboard? Why is this admin user restricted?
INSERT INTO
wp_database
.wp_users
(ID
,user_login
,user_pass
,user_nicename
,user_email
,user_url
,user_registered
,user_activation_key
,user_status
,display_name
) VALUES (‘1’, ‘admin’, MD5(‘test’), ‘User Name’, ‘[email protected]’, ‘https://usersite.com’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘User Name’);INSERT INTO
wp_database
.wp_usermeta
(umeta_id
,user_id
,meta_key
,meta_value
) VALUES (NULL, ‘1’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;b:1;}’);INSERT INTO
wp_database
.wp_usermeta
(umeta_id
,user_id
,meta_key
,meta_value
) VALUES (NULL, ‘1’, ‘wp_user_level’, ’10’);
- The topic ‘user created via SQL can't log in to dashboard’ is closed to new replies.