I was out of balance with my payments and after the payment made it still shows "Error...

July 5, 2016 330 views
Billing WordPress Ubuntu 16.04

I was out of balance with my server payments and after the payment it still shows "Error establishing a database connection" and I cannot access my website.
How to restart the server or whats wrong.
Restarting Apache and mysql did not help.

1 Answer

This error generally indicates that your MySQL service is not responding. If no changes were made to WordPress' wp-config.php then the MySQL service is the place to start.

You mentioned already trying to restart MySQL, this can be done with the command:

service mysql restart

If you continue to see the error message, I would then recommend checking the files in /var/log/mysql/ as there is likely an error recorded there. If you can share any error message you find there with us we can figure out the next step.

  • I made changes in wp-config.php before but I edit the changes back because it did not work right now. I tried to change the domain settings.

    service mysql restart - not working. Only sudo command is working.

    If I try to access /var/log/mysql/ then messages appears:
    Error: Directory /var/log/mysql: permission denied
    Error: Failed to retrieve directory listing

  • I was able to accès log files from FileZilla.
    I used Terminal and command sudo cat /var/log/syslog to access the file.

    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24583]: Upgrading MySQL tables if necessary.
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24586]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24586]: Looking for 'mysql' as: /usr/bin/mysql
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24586]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24586]: This installation of MySQL is already upgraded to 5.5.49, use --force if you still need to run mysql_upgrade
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24597]: Checking for insecure root accounts.
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24602]: WARNING: mysql.user contains 3 root accounts without password!
    Jul  6 07:04:19 wordpress-1gb-ams3 /etc/mysql/debian-start[24603]: Triggering myisam-recover for all MyISAM tables
    Jul  6 07:09:01 wordpress-1gb-ams3 CRON[24804]: (root) CMD (  [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
    Jul  6 07:17:01 wordpress-1gb-ams3 CRON[24846]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
    Jul  6 07:39:01 wordpress-1gb-ams3 CRON[25117]: (root) CMD (  [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
    Jul  6 08:09:01 wordpress-1gb-ams3 CRON[25569]: (root) CMD (  [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
    Jul  6 08:17:01 wordpress-1gb-ams3 CRON[25683]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
  • I got mysql error also

    sudo cat /var/log/mysql/error.log
    160706  7:04:15 [Note] /usr/sbin/mysqld: Normal shutdown
    160706  7:04:15 [Note] Event Scheduler: Purging the queue. 0 events
    160706  7:04:15  InnoDB: Starting shutdown...
    160706  7:04:17  InnoDB: Shutdown completed; log sequence number 59577283
    160706  7:04:17 [Note] /usr/sbin/mysqld: Shutdown complete
    160706  7:04:17 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
    160706  7:04:17 [Note] Plugin 'FEDERATED' is disabled.
    160706  7:04:17 InnoDB: The InnoDB memory heap is disabled
    160706  7:04:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    160706  7:04:17 InnoDB: Compressed tables use zlib 1.2.8
    160706  7:04:17 InnoDB: Using Linux native AIO
    160706  7:04:17 InnoDB: Initializing buffer pool, size = 128.0M
    160706  7:04:17 InnoDB: Completed initialization of buffer pool
    160706  7:04:17 InnoDB: highest supported file format is Barracuda.
    160706  7:04:17  InnoDB: Waiting for the background threads to start
    160706  7:04:18 InnoDB: 5.5.49 started; log sequence number 59577283
    160706  7:04:18 [Note] Server hostname (bind-address): ''; port: 3306
    160706  7:04:18 [Note]   - '' resolves to '';
    160706  7:04:18 [Note] Server socket created on IP: ''.
    160706  7:04:18 [Note] Event Scheduler: Loaded 0 events
    160706  7:04:18 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.5.49-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
Have another answer? Share your knowledge.