Skip to main content

WordPress Not sufficient permissions to access admin page

While installing WordPress for my blog, I was trying out different subdomain/ folder options.

After final installation when I tried to access the admin page I was being redirected to /wp-admin/profile.php but getting insufficient permission error like shown below.

not sufficient permission

I could access the front page easily but couldn’t log in admin panel.

I tried changing the permission of WordPress files  and directories to 755 but to no avail.

The problem was that while installing WordPress I used different table prefixes each time.

table_prefix

WordPress uses the table prefix for forming the option and usermeta keys name for storing roles and capabilities information.

So in the process, database tables had correct table prefixes but some records in the some  of the tables still had old table prefix and this was causing the problem.

To fix the issue you need to update your database using phpMyAdmin or php.

Check in your database in the usermeta and options table if they have correct table prefix in all the fields.

UPDATE `wp_usermeta` SET `meta_key` = replace(`meta_key`, 'old_prefix', 'current_prefix');
UPDATE `wp_options` SET `option_name` = replace(`option_name`, 'old_prefix', 'current_prefix');

Make sure to change old_prefix and new_prefix accordingly.

You can find the current prefix from wp-config.php.


If it’s still not working check all the rows manually and also all the other tables.


This solved the problem for me.

Comments

Popular posts from this blog

How to split large mp3 files using mp3splt

If you have a  lengthy  or large MP3 file and you want to  split  it into files of smaller size or duration, You can easily do this using mp3splt. Mp3splt   is an utility to split mp3 and ogg vorbis digital audio files without the need of decoding. It can be used to split a file into no of tracks of fixed duration and size or specified  split points. It supports variable bit rate mp3 files, silent detection, splitting with local .XMCD, .CDDB or .CUE file splitpoints or from external servers like   tracktype.org . It copies the original files first and then generates new, smaller files during the process of splitting without altering the original file. It does not do any encoding or decoding so the splitting is very fast and lossless. Steps to follow Navigate to directory where you have downloaded mp3splt { if using portable version } . Run and execute mp3slpt using the command   mp3splt  . Specify the options according to which you wanna split. The basic syntax is   mp3splt [file path]...

Managing multiple Window in Windows7

If you work with multiple windows open in background, you must have spent a lot of time switching back and forth between them even for simple tasks like copying files or comparing text. You can save a lot of hard work of switching back and forth by cascading them or stacking or displaying them side by side. Cascade , puts windows in a single stack that has been fanned out . Stacked , puts windows in one or more vertical stacks . Side by side , places all open windows , in a side by side arrangement so you can see all the windows at once. Arrange windows in a cascade (left), vertical stack (center), or side-by-side pattern (right) You can do this easily by Right Click on empty area on Taskbar and choosing the arrangement you want. You can also snap an open window to Left/Right side by using the Windows logo key +Left Arrow or Windows logo key +Right Arrow

Generate required CSS for your sprites

If you are a CSS developer then you'll love this tool. Sprite Cow is an open source and online web app that generates necessary CSS based on your sprites like background-position, width, height etc. The source is available on GitHub