Changing the database prefix: admin rights gone
-
Last night I went to hell and back with WordPress. I had to install a new site for a client. The problem was that he had only one database and there was already a WP instance running that was using wp_ as a database table prefix. I had been using that on the development site which forced me to change all table names from wp_something into maghreb_something.
I set everything up, modified wp-config.php to reflect the new database prefix. Then the problems started. I logged on as admin and found that I had no rights to do anything. It was like I was just a registered user. I checked the options table to verify that my userlevel was 10. I even tried to register a brand new user and set it’s userlevel to 10 manually but not to avail.
I Googled around and found some obscure message stating that changing the database prefix could result in this behaviour. I ended up letting WordPress install a clean database on the client’s site with prefix maghreb_ for the database. After that I manually created all tables and inserted the data from the development site while omitting the users table, the usermeta table and the options table. Then I manually inserted all options fields except for everything that WP creates at install to make sure I wouldn’t recreate the original problem.
After this horror I could finally access my stuff as admin.
My question is: Was there an easier way to fix this that I don’t know about and couldn’t find even after extensive searching and googling?
If there isn’t I’m sure this post will help some people experiencing the same problem.
- The topic ‘Changing the database prefix: admin rights gone’ is closed to new replies.