Failed to Start MySQL Community Server – Failed to start mysqld.service: Unit not found.

Failed to Start MySQL Community Server – Failed to start mysqld.service: Unit not found.

MySQL service failed with result: exit-code; In this tutorial, you will learn how to fix/resolve MySQL service failed with result: exit-code or failed to start mysql.service: unit mysql.service not found linux.

If you are trying to start, stop, restart, and the status of your MySQL, but you are facing the following errors

  • failed to start MySQL community server
  • Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details.
  • failed to start mysql.service: unit mysql.service not found.
  • failed to start mysql.service unit not found linux

Failed to start SQL Community Server — Job for mysql.service failed because the control process exited with error code

Using the following steps, you can fix/resolve failed to start mysql.service: unit mysql.service not found linux or Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details:

  • Step 1 – Login to Your SSH Server
  • Step 2 – Reinstall MySQL
  • Step 3 – Restart MySQL Server

Step 1 – Login to Your SSH Server

First of all, you need to login into your ssh server with username and password.

Step 2 – Reinstall MySQL

Then execute the following command into your terminal to “purge” every file related to MySQL and reinstall mysql-server:

sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get install mysql-server 

Step 3 – Restart MySQL Server

Finally, execute the following command in your terminal to restart your MySQL server:

sudo systemctl restart mysql

Even after following the above steps, if you are still not able to start, stop and restart your MySQL server then you just use one command to solve the MySQL server related issue. which is given below:

Execute the following command into your terminal:

nano /etc/mysql/mysql.conf.d/mysqld.cnf

OR 

vi /etc/mysql/mysql.conf.d/mysqld.cnf

After that, add the following line to your MySQL.cnf file:

innodb_force_recovery = 2

Finally, execute the following command into your terminal to stop and start your mysql server:

sudo systemctl stop mysql.service   ---to shut it down
sudo systemctl start mysql.service  ---to try and start up and see the reason why it is not starting.

Conclusion

That’s it; In this tutorial, you have learned how to fix/resolve failed to start mysql.service: unit mysql.service not found linux or Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details.

Recommended Tutorials

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *