#I have just installed Mysql server on Ubuntu 22.04 but everytime I try to start it I am experiencing errors:
-When I try to launch it using “sudo mysql” in the terminal I get the following error:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
-Using “sudo service mysql start” in the terminal I get:
Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xeu mysql.service” for details.
-When I run “systemctl status mysql service” I get the following output:
Unit service.service could not be found. × mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; disabled; preset: enabled) Active: failed (Result: exit-code) since Thu 2023-01-12 11:41:02 UTC; 22s ago Process: 32000 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE) CPU: 5ms
Jan 12 11:41:02 appdev systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5. Jan 12 11:41:02 appdev systemd[1]: Stopped MySQL Community Server. Jan 12 11:41:02 appdev systemd[1]: mysql.service: Start request repeated too quickly. Jan 12 11:41:02 appdev systemd[1]: mysql.service: Failed with result ‘exit-code’. Jan 12 11:41:02 appdev systemd[1]: Failed to start MySQL Community Server.
#SO how can I solve this problem? Please help
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
I’ve just tried this on a fresh new Ubuntu 22.04 Droplet and I installed MySQL with the following command:
And then I was able to access MySQL with the following command:
In your case, I would recommend checking the MySQL error log so that you could see what might be causing the problem. You can check the log with the following command:
Let me know how it goes!
Best,
Bobby
Hello @chiefagibu
Just to add something to what have already been mentioned. We have a tutorial on accessing MySQL error logs and troubleshooting MySQL errors which you can check here:
https://www.digitalocean.com/community/tutorials/how-to-access-mysql-error-logs
https://www.digitalocean.com/community/tutorial_series/how-to-troubleshoot-issues-in-mysql
Regards