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

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

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

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

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

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including 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. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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