WordPress.org

Ready to get started?Download WordPress

Forums

[closed] wp-admin, You do not have sufficient permissions to access this page. (12 posts)

  1. Paul Kerins
    Member
    Posted 1 year ago #

    I am having a problem getting into wp-admin on a local install of WordPress, I am using WAMP. I searched extensively for a solution and found none and I am hoping someone may be able to point me in the right direction.

    I set up new site that I am working on and had zero problems, I then did another install of my current live site and had many problems mostly database related, but I resolved those and I now can see the site and all the content on localhost, but I can not get into wp-admin. Sometimes the log-on page shows up and I fill in the fields and press enter and I get a error message that says, "You do not have sufficient permissions to access this page.". Other times the log-on page does not show up at all and I just get that error message.

    I am not ruling out a database error of some kind, but I think the error is the kind of security permissions you grant to a file, I am on a windows 7 machine so I changed all the permissions of the folder and sub-files to have complete permissions but that did not work, the only other kind of permissions I can think of is the kind you can change with a FTP client but since I am on a localhost and I do not think I can do this, I did search to see if I could but there was no solution, so as far as I know this can not be done.

    I did try force-upgrade.php and that reported that the database was ok but I still could not access wp-amin. I also disabled every plugin one by one and no luck there, plus I delete all the cache files from the plugins that cached the site. Almost always I am able to resolve problems by searching for them but this time I am stumped. I saw a few other people having the same issue but no solution. Any help is appreciated.

  2. Paul Kerins
    Member
    Posted 1 year ago #

    I ended up installing a fresh local WordPress and only copied photos from my upload folder and my theme, and the install went fine and was able to access the wp-admin page. It was only after I uploaded my database back-up that I then got the same error as before. "You do not have sufficient permissions to access this page." So it is a database issue. I can log in, but after logging on when the page should be the admin page I get this error. So to recap I can see my site and content, there are no plugins at all, I rest both urls for loacalhost site in options in phpmyadmin and even tried again to reset database by changing the version back in db_version in phpmyadmin, hoping it would over-write anything that was blocking my access. I have no idea what to look for in the database in order to resolve this problem. Any thoughts ?

  3. BartDev
    Member
    Posted 1 year ago #

    I have a very similar problem. Did anyone found a solution or has any suggestions?

  4. mbolsinga
    Member
    Posted 1 year ago #

    Paul, I had the same problem and resolved it. This error message appears to be a catch-all from WordPress. In other words, the problem can be one of many things. You've done a lot of the things I found as solutions for other people's issues that resulted in that error message. I did most of them also, and they didn't work for me. The fix for me was to use the force-upgrade.php. But you've already done that, so here's what else I found out.

    I found that the most common solution seemed to have to do with a mis-match between your wp-config.php. First of all, make sure you (or the WordPress install) has correctly set up the database name, database user name, database password, and database host. See this link: http://codex.wordpress.org/Editing_wp-config.php

    Secondly, make sure the database table prefix in your config.php matches the table name prefixes in your database. The default is wp_, but if you (or your wordpress install) changed your prefix to something else, it must match the database itself.

    Here's an example of the fields I'm talking about in the wp-config.php.

    <?php
    /** WordPress's config file **/
    /** http://wordpress.org/   **/
    
    // ** MySQL settings ** //
    define('DB_NAME', 'madeupname');     // The name of the database
    define('DB_USER', 'madeupuser');     // Your MySQL username
    define('DB_PASSWORD', 'madeuppw'); // ...and password
    define('DB_HOST', 'mysql.yoursite.com');     // ...and the server MySQL is running on
    // Change the prefix if you want to have multiple blogs in a single database.
    $table_prefix  = 'wp_';   // example: 'wp_' or 'b2' or 'mylogin_'

    In your database, using phpMyAdmin, check that the tables all begin with the same prefix that you have in your wp-config.php. For example if you changed your table prefix to "b2", the tables would be "b2_commentmeta", b2_comments", etc.
    Also, you have to check inside two tables to see that certain field names are also changed. So, using the same prefix as above, in b2_options, the field wp_user_roles has to be changed to b2_user_roles. And in the b2_usermeta table, the fields wp_capabilities, wp_user_level, wp_user-settings, wp_user-settings-time, and wp_dashboard_quick_press_last_post_id should all have the prefix b2_ instead of wp_.

    And lastly, within your database, look at the values in the wp_usermeta table as follows:

    wp_capabilities should be a:1:{s:13:"administrator";s:1:"1";}

    wp_user_level should be 10

    All of this should automatically work if you used a quick install, but if you've changed anything along the way, or if your install did not work, it could be messed up. I did have this problem initially, and found out that the quick install done by Dreamhost was incomplete. Though I fixed the prefix problem, I still had the "permissions" error. However, when I tried that force.upgrade.php, all was resolved.

    Good luck,
    Marcia

  5. joeshock
    Member
    Posted 1 year ago #

    Throwing this out there because it worked for me and I don't believe it was one of the troubleshooting ideas mentioned above.

    In my situation I was adding a bunch of extra code to the wp-config.php file to detect what server['host'] I was on and then switch the database name, username and password to connect to. Problem appeared to be that there was too much code above the other define method calls to complete inline quick enough. I ended up wrapping the "server environment detection" script in a function and calling it right before the other define method calls and it worked like a charm!

  6. alesub
    Member
    Posted 1 year ago #

  7. scobar
    Member
    Posted 1 year ago #

    mbolsinga - thanks so much for your post. I was having this exact issue, and was going through all the tables, changing everything I could! I did not know to change the wp_user_role field - once I did that, I could login to my site again. Most excellent!

  8. jaewoo
    Member
    Posted 1 year ago #

    I hope this will help you. :)

    Find "wp-config.php" file

    find line

    //define (′WPLANG′, '');

    to

    define (′WPLANG′, ′en-EN′); <- this "en-EN" can be your language set.

    $_SERVER['SERVER_SOFTWARE'] = 'Apache';

    save and refresh your browser and it should be works.

  9. markkellyeire
    Member
    Posted 1 year ago #

    Thanks mbolsinga, worked perfectly, you just made my day :)

  10. manish_gori
    Member
    Posted 1 year ago #

    Thanks mbolsinga, this worked for me:
    wp_capabilities should be a:1:{s:13:"administrator";s:1:"1";}

    wp_user_level should be 10

  11. sanjeevici
    Member
    Posted 1 year ago #

    Thanks mbolsinga

    Now working perfectly.. :-)

    [sig moderated as per the Forum Rules]

  12. jackie777
    Member
    Posted 1 year ago #

    Thanks mbolsinga,
    This worked for me when setting up a mirror site -
    THANK YOU

Topic Closed

This topic has been closed to new replies.

About this Topic