How to Start, Stop, and Restart MySQL Server in Linux Ubuntu

Start, stop, or restart your MySQL server; In this tutorial, you will learn three different methods to start, stop and restart mysql server on linux ubuntu using command line.

How to Start, Stop, and Restart MySQL Server in Linux Ubuntu

To start, stop or restart your MySQL server on a Linux ubuntu, you can follow the following three different commands that can be used to start, stop and restart MySQL server on linux ubuntu using the command line:

  • Using Service Command
  • Using init/d Command
  • Using systemctl Command

Using Service Command

If you are using service distribution of MySQL, so you need to run the following service command to start, stop and restart of your MySQL server on Linux ubuntu using command line:

To start MySQL server:

sudo service mysqld start

To stop MySQL server:

sudo service mysqld stop

To restart MySQL server:

sudo service mysqld restart

Using init/d Command

If you are using init/d distribution of MySQL, so you need to run the following init/d command to start, stop and restart of your MySQL server on Linux ubuntu using command line:

To start MySQL server:

sudo /etc/init.d/mysqld start

To stop MySQL server:

sudo /etc/init.d/mysqld stop

To restart MySQL server:

sudo /etc/init.d/mysqld restart

Using systemctl Command

If you are using systemctl distribution of MySQL, so you need to run the following systemctl command to start, stop and restart of your MySQL server on Linux ubuntu using command line:

To start MySQL server:

sudo systemctl start mysqld

To stop MySQL server:

sudo sudo systemctl stop mysqld

To restart MySQL server:

sudo systemctl restart mysqld

Conclusion

That’s all; In this tutorial, you have learned three different methods to start, stop and restart MySQL server on Linux ubuntu using command line.

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 *