To restart MariaDB, you can use the following methods depending on your operating system:
Run the following command in the terminal:
sudo systemctl restart mariadb
Or (if the service is named mysql instead of mariadb):
sudo systemctl restart mysql
Use the service command:
sudo service mariadb restart
Or:
sudo service mysql restart
If you can access the MariaDB shell as root, you can restart it with:
SET GLOBAL innodb_fast_shutdown = 0;
SHUTDOWN;
Then start it again from the system service (as shown above).
If you're managing a MariaDB database on a Tencent Cloud CVM (Cloud Virtual Machine) and need to restart the service after configuration changes, use:
sudo systemctl restart mariadb
Ensure the service starts successfully by checking its status:
sudo systemctl status mariadb
For Tencent Cloud Database for MariaDB, restarting is managed via the Tencent Cloud Console or API. Navigate to the Database Instance page, select your MariaDB instance, and click Restart in the operation menu.
If you encounter issues, check logs at /var/log/mysql/error.log or /var/log/mariadb/mariadb.log.