Hi,
I’m getting an “Error establishing a database connection” in WordPress, and on further inspection it looks like the MySQL service isnt running.
When I try and run sudo service mysql start
, I get:
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
If I run systemctl status mysql.service
I get:
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Mon 2019-06-03 09:00:20 UTC; 18s ago
Process: 936 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
running sudo journalctl -xn
gives me:
-- Logs begin at Mon 2019-06-03 08:58:05 UTC, end at Mon 2019-06-03 09:09:21 UTC. --
Jun 03 09:09:01 roofingsheetsbyrhino cron[509]: Authentication token is no longer valid; new one required
Jun 03 09:09:01 roofingsheetsbyrhino cron[509]: Authentication token is no longer valid; new one required
Jun 03 09:09:09 roofingsheetsbyrhino sshd[991]: Invalid user share123 from 106.12.24.108
Jun 03 09:09:09 roofingsheetsbyrhino sshd[991]: input_userauth_request: invalid user share123 [preauth]
Jun 03 09:09:09 roofingsheetsbyrhino sshd[991]: pam_unix(sshd:auth): check pass; user unknown
Jun 03 09:09:09 roofingsheetsbyrhino sshd[991]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=106.12.24.108
Jun 03 09:09:10 roofingsheetsbyrhino sshd[991]: Failed password for invalid user share123 from 106.12.24.108 port 55360 ssh2
Jun 03 09:09:11 roofingsheetsbyrhino sshd[991]: Received disconnect from 106.12.24.108: 11: Bye Bye [preauth]
Jun 03 09:09:21 roofingsheetsbyrhino sudo[993]: tom : TTY=pts/0 ; PWD=/var/www ; USER=root ; COMMAND=/bin/journalctl -xn
Jun 03 09:09:21 roofingsheetsbyrhino sudo[993]: pam_unix(sudo:session): session opened for user root by tom(uid=0)
I’m really not sure what the issue is here, or how this has come about - any advice as to what I should do next would be hugely appreciated!
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Embarrassingly, I just realised that the issue here was my backup plugin had piled up loads of backups rather than deleting the old ones… So the droplet had run out of disk space which was causing the issues.
So I’ve fixed the problem! Thanks for your help asciant!
here is my /etc/mysql/mysql.conf.d/mysqld.cnf file replace it with yours and make chmod 777 it should work.
Hello there,
For anyone that runs into a similar issue, I’ll recommend checking:
If you have recently made any changes to the MySQL configuration or any general changes on the droplet. Check what the changes are and if possible try to revert them and test if the issue is resolved.
Examine the server’s resource usage and check if there is anything that consumes the server’s memory or CPU.
Check the MySQL error log for a specific error message.
Additionally, you can check
/var/log/syslog
for any references to the MySQL service that can help to resolve the issue.We also have an article on How To Troubleshoot Issues in MySQL
https://www.digitalocean.com/community/tutorial_series/how-to-troubleshoot-issues-in-mysql
Regards