Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • @semyl I understand the user facing error message being deliberately vague to not expose internal details publicly. But not having a proper error message on the backend, in a log file somewhere, that lays out why it’s erroring seems like a big miss. The code knows it can’t find a table, can’t access a file, doesn’t have permission, etc. WP should catch that error and log it, so it can be properly addressed.

    Here is what worked for me. I was moving a wordpress site from one host to a new host.
    After coping over the php files and database backup, and updating wp-config.php with the updated database login info, I received this “Sorry, you are not allowed to access this page” error when I would try to access /wp-admin/ after login.

    My issue turned out to be the MySQL global database variable:
    lower_case_table_names
    The old host had this set to 0, my new host had this set to 1.
    You can check with:
    show variables where Variable_name='lower_case_table_names'

    Since this is a global variable, there are limited options for changing this.
    For what ever reason, the site I was moving had mysql tables using lower case table prefixes. So rather then wp_users it was: a1b23cd_users
    When I searched my mysql backup sql file for the a1b23cd prefix, I would I mixture of “a1b23cd” and “A1B23cd”.
    I don’t know how they came to be mixed case, and since the database was set to accept mixed case, this wasn’t a problem previously.

    I fixed it by doing a search and replace in notepad++ and replacing all instances of the database prefix with the lowercase version.

    Then I restored a new copy of the database, and it works fine now.
    None of the long lists of items to troubleshoot this issue mentioned this setting.
    I came across it because I noticed the the tablename prefixes I saw in phpMyAdmin were lowercase and the $table_prefix value in wp-config was mixed case. So I started going down this rabbit hole, and fixed it this way.
    I hope this helps someone else.

    • This reply was modified 4 years, 9 months ago by mirx1.
Viewing 2 replies - 1 through 2 (of 2 total)