I’m trying to install mysql but I cannot start the service and cannot locate mysqld.sock
I am following the how to here: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
And get stuck trying to run
I get this error:
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Checking the version does show it installed.
mysql --version mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
I am unable to locate the mysqld.sock file anywhere and there is also no mysqld dir in /var/run/
I’ve also been through this troubleshooting doc https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-socket-errors-in-mysql
But I can’t start the mysql service and there is nothing in the mysql.cnf file other than this
# The MySQL database client configuration file # # Ref to https://dev.mysql.com/doc/refman/en/mysql-command-options.html [mysql]
This is what mysql.service shows
systemctl status mysql.service ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (start) since Thu 2020-09-10 14:31:23 UTC; 15s ago Process: 8847 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 8855 (mysqld) Status: "Server startup in progress" Tasks: 4 (limit: 533) Memory: 2.5M CGroup: /system.slice/mysql.service └─8855 [mysqld]
If I run it again the Process / Main PID changes. Does that mean it’s just taking a while to complete and I need to be patient?
I’ve uninstalled mysql a few different times but can’t seem to get it sorted.
Any help appreciated.
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.
Click below to sign up and get $200 of credit to try our products over 60 days!
Hi there @dezshredder,
To me it looks like that your MySQL service is stuck in a crash loop as the status output that you’ve shared indicates that the status is:
"Server startup in progress"and the uptime is 15 seconds.
I would recommend checking your MySQL error log for more information on what might be wrong.
Also, I could suggest checking your
/var/log/sysloglog for more information as well.
Feel free to share the errors from the logs here so that I could try to advise you further.
Bumping up the Droplet did the trick!
I’m up and running.
Guess that’s what I get for being frugal and going with the cheapest option.
Thanks for the help @bobbyiliev!
Yeah something is definitely stuck.
tailing syslog shows mysql restarting over and over
It went from restart count 17 to 24 while writing this response.
Also load is very high on this droplet. htop shows average of 3.96
I also rebooted the whole droplet when I saw the load so high but it just started climbing again presumably due to mysql issues.
Thanks for the help @bobbyiliev .