📜  ubuntu restart mariadb - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:48:06.956000             🧑  作者: Mango

Ubuntu Restart MariaDB - Shell-Bash

Introduction

In this guide, we will learn how to restart the MariaDB server on an Ubuntu system using Shell-Bash commands. We will explore different methods to accomplish this, ensuring a smooth restart of the database server.

Prerequisites

To follow this tutorial, you should have:

  • An Ubuntu operating system
  • MariaDB installed and running on your system
Restarting MariaDB using systemctl

The systemctl command is used to manage services in Ubuntu. Follow these steps to restart MariaDB:

  1. Open a terminal.

  2. Run the following command to restart MariaDB:

sudo systemctl restart mariadb
  1. Provide your system password if prompted.

  2. MariaDB will be restarted, and you should see a success message if the restart was successful.

Restarting MariaDB using service

The service command is another method to manage services. Here's how you can restart MariaDB using service:

  1. Open a terminal.

  2. Run the following command to restart MariaDB:

sudo service mysql restart
  1. Provide your system password if prompted.

  2. MariaDB will be restarted using the service command, and you should see a success message if the restart was successful.

Restarting MariaDB using init.d script

The init.d script is an older method to manage services. Although it is less commonly used now, it is still supported in many systems. Here's how you can restart MariaDB using the init.d script:

  1. Open a terminal.

  2. Run the following command to restart MariaDB:

sudo /etc/init.d/mysql restart
  1. Provide your system password if prompted.

  2. MariaDB will be restarted using the init.d script, and you should see a success message if the restart was successful.

Conclusion

In this guide, we have explored different methods to restart the MariaDB server on Ubuntu using Shell-Bash commands. You can choose the method that suits your needs and system requirements. Now you can efficiently restart MariaDB on your Ubuntu system whenever necessary.