📅  最后修改于: 2023-12-03 14:48:06.956000             🧑  作者: Mango
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.
To follow this tutorial, you should have:
The systemctl command is used to manage services in Ubuntu. Follow these steps to restart MariaDB:
Open a terminal.
Run the following command to restart MariaDB:
sudo systemctl restart mariadb
Provide your system password if prompted.
MariaDB will be restarted, and you should see a success message if the restart was successful.
The service command is another method to manage services. Here's how you can restart MariaDB using service:
Open a terminal.
Run the following command to restart MariaDB:
sudo service mysql restart
Provide your system password if prompted.
MariaDB will be restarted using the service command, and you should see a success message if the restart was successful.
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:
Open a terminal.
Run the following command to restart MariaDB:
sudo /etc/init.d/mysql restart
Provide your system password if prompted.
MariaDB will be restarted using the init.d script, and you should see a success message if the restart was successful.
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.