Not able to login to wordpress -Database Error

Azka Munawar 11 Reputation points
2022-07-04T20:29:16.863+00:00

I was transferring wordpress website from local to live server azure hosting and due to problems with migration plugin my website has crashed and i cannot login to wordpress.Its showing message"Error in Establishing Database Connection".Because one or more of the tables have been removed.

Azure SQL Database
{count} vote

3 answers

Sort by: Most helpful
  1. Oury Ba-MSFT 15,116 Reputation points Microsoft Employee
    2022-07-13T23:03:23.8+00:00

    @Azka Munawar Thank you for posting your question on Microsoft Q&A forum.
    When did this error occur and was this working before.?

    **How to Fix the Error Establishing a Database Connection in WordPress? **

    You get this error when WordPress is unable to establish a database connection. The following reasons could be the reason why the issue occurs:
    Database information in wp-config.php file may be incorrect
    Use MySQL Client to access your database with the information in wp-config.php to verify this.
    Check if both the front end and back end of your WordPress site are returning the different errors
    If you are getting a different error on the wp-admin page for instance something like “One or more database tables are unavailable. The database may need to be repaired”, then you need to repair your database. To do this add the following wp-config.php file:

    define ('WP_ALLOW_REPAIR', true);

    For more details, please check this blog https://azure.microsoft.com/en-us/blog/wordpress-troubleshooting-techniques-on-azure-websites/

    Regards,
    Oury

    1 person found this answer helpful.

  2. Ronen Ariely 15,081 Reputation points
    2022-07-14T00:10:58.187+00:00

    Hi ,

    Its showing message"Error in Establishing Database Connection".Because one or more of the tables have been removed.

    According to your error message the connection to the database was OK since it came to a step of using specific tables. This mean that you probably have more information in the SQL Server side.

    You can use Extended Events or profiler to monitor which exact query failed and according to that query check which table related to the issue.

    Please clarify, are you using MySQL or Azure SQL Database or something else? Is your site run on your Azure Virtual machine?

    1 person found this answer helpful.

  3. alexwood45 6 Reputation points
    2023-01-30T19:02:36.6733333+00:00

    Hi,

    Sometimes i also face this error on site of calculette heure de travail . I am unable to login to wordpress.Its showing message"Error in Establishing Database Connection.

    1 person found this answer helpful.