- July 15, 2013 at 11:48 am #29887
Compare the database table prefix in phpMyAdmin and your wp-config.php. Are they the same? Did you have a plugin that changed something? In wp-config.php you can set the table prefixes to whatever you want. For this example, just say that I've set $table_prefix to 'wp_blabla_'.In the "usermeta" table, "wp_blabla_usermeta," there were settings for "wp_user_level" and "wp_capabilities"; However these should have said wp_blabla_user_level" and "wp_blabla_capabilities" respectively.Likewise, in the options table, "wp_blabla_options", there was an option for "wp_user_roles" that should have said "wp_blabla_user_roles".Changing those settings fixed the problem for me.The thing is that WordPress uses the $table_prefix variable for forming the option and usermeta keys names, where it's storing the roles and capabilities information. So once you change the prefix, but don't update your db, you get this error. Here's how to fix it - execute this SQL command through phpMyAdmin, or a different interface for interacting with your DB(you can do it with PHP as well):So if your old $table_prefix was wp_blabla_ and your new one is wp_, you would do this query:Code:UPDATE `wp_usermeta` SET `meta_key` = replace(`meta_key`, 'wp_blabla_', 'wp_');UPDATE `wp_options` SET `option_name` = replace(`option_name`, 'wp_blabla_', 'wp_')
You must be logged in to reply to this topic.