How7o
  • Home
  • Tools
  • Prank Screens
  • Contact
  • Blog
Reading: How to Restart the MariaDB Server on Linux
Share
Subscribe Now
How7oHow7o
Font ResizerAa
  • Marketing
  • OS
  • Features
  • Guide
  • Complaint
  • Advertise
Search
  • Home
  • Tools
  • Prank Screens
  • Contact
  • Blog
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.
How7o > Blog > Server Management > How to Restart the MariaDB Server on Linux
Server Management

How to Restart the MariaDB Server on Linux

how7o
By how7o
Last updated: May 10, 2026
6 Min Read
MariaDB restart on Linux — systemctl restart mariadb
SHARE

To mariadb restart on a modern Linux system, run sudo systemctl restart mariadb. If the service is called mysql or mysqld on your distribution, swap the name. The legacy service mariadb restart wrapper still works — it forwards to systemctl. This guide covers every form, when to reload instead of restart, and how to verify the service came back up.

Contents
  • TL;DR
  • Pick the right service name
  • Restart vs reload
  • Verify it’s back up
  • When a restart isn’t enough
  • Frequently asked questions
  • Related guides
  • References

Last verified: 2026-04-23 on Ubuntu 22.04, AlmaLinux 9, and CentOS 7 (EOL). Originally published 2022-12-31, rewritten and updated 2026-04-23.

TL;DR

# Modern (systemd)
sudo systemctl restart mariadb

# If the service is named differently
sudo systemctl restart mariadb.service
sudo systemctl restart mysql
sudo systemctl restart mysqld

# Legacy wrapper (still works, forwards to systemctl)
sudo service mariadb restart
sudo service mysql restart
sudo service mysqld restart

Pick the right service name

  • Ubuntu / Debian with MariaDB package — mariadb.
  • Ubuntu / Debian with MySQL package — mysql.
  • CentOS / RHEL / AlmaLinux / Rocky — mariadb (or mysqld on older installs).
  • Amazon Linux 2 — mariadb.

Not sure which name to use? List all three:

systemctl list-unit-files | grep -E 'mariadb|mysql'

The one marked enabled is the service that starts on boot — that’s the one to restart.

mariadb restart — systemctl commands across Linux distributions

Restart vs reload

# Full stop + start — drops connections, ~seconds downtime
sudo systemctl restart mariadb

# Keep connections alive, re-read config — faster, no downtime
sudo systemctl reload mariadb

reload is faster and keeps existing connections alive but only works for config changes that MariaDB can apply live. Most system variables do work; changing the InnoDB buffer pool size, loading/unloading a plugin, or swapping the data directory all require restart. When in doubt, check SHOW VARIABLES LIKE '...' after a reload to confirm the new value took effect — if it didn’t, go back and restart.

Verify it’s back up

# Service-level check
sudo systemctl status mariadb

# Expect "Active: active (running)" in green, no failed units.

# Connection-level check
mysql -u root -p -e 'SELECT VERSION();'

Both checks are quick. If systemctl says active but mysql -u root -p hangs, the server is listening but not accepting queries — usually a data-directory corruption that needs the log: journalctl -u mariadb -n 100 --no-pager.

When a restart isn’t enough

If systemctl restart returns quickly but MariaDB is still unavailable, you’re into troubleshooting territory — config syntax errors, disk full, orphaned PID files, port conflicts. See troubleshooting a MariaDB that won’t start for the triage checklist.

Frequently asked questions

What’s the shortest mariadb restart command?

sudo systemctl restart mariadb. That’s the canonical form on every distribution using systemd (Ubuntu 16.04+, Debian 8+, CentOS 7+, RHEL 7+, AlmaLinux, Rocky). The legacy service mariadb restart wrapper also works and just forwards to systemctl on modern systems.

Why is the service sometimes called mysql or mysqld?

MariaDB shipped as a drop-in MySQL replacement, and some distributions kept the original service names for compatibility. On CentOS/RHEL the service is called mariadb; on some Debian/Ubuntu packages it’s mysql; on older Red Hat derivatives you’ll find mysqld. systemctl status mariadb mysql mysqld — whichever returns ‘loaded’ is the one running.

Should I use restart or reload?

restart fully stops and starts the service — every connection is dropped. reload is lighter: it signals the running process to re-read its config without killing connections. Reload works for most my.cnf changes that don’t require a fresh server instance. Restart is necessary for changes to InnoDB buffer pool size, plugin loading, or anything that needs the engine re-initialized.

How do I check if the restart worked?

sudo systemctl status mariadb — the output shows ‘active (running)’ in green if it’s up. The log excerpt underneath (or journalctl -u mariadb -n 50) reveals any startup errors. For a connection-level check, mysql -u root -p -e 'SELECT VERSION();' confirms the server is accepting queries.

What if systemctl restart fails?

Check the log with journalctl -u mariadb -n 100 --no-pager. Common causes: syntax error in /etc/mysql/my.cnf (typos, missing quotes), disk full (df -h), orphaned PID file (/var/run/mysqld/mysqld.pid), or a port conflict. See troubleshooting MariaDB not starting for the full triage.

Related guides

  • How to Troubleshoot MariaDB Not Starting — what to do when restart fails.
  • How to Install MySQL on Ubuntu — a fresh install where the service starts out clean.
  • How to Connect to a Remote MySQL Database from Ubuntu — companion connectivity guide.
  • How to Create Users and Grant Privileges in MySQL 8 — post-restart user admin.

References

systemd service docs: freedesktop.org/software/systemd/man/systemctl. MariaDB restart: mariadb.com/kb/en/starting-and-stopping-mariadb-automatically.

TAGGED:centosconfigurationmariadbmysqlUbuntu

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article MySQL remove string from column — REPLACE and REGEXP_REPLACE patterns How to Remove a Specific String from a Column in MySQL
Next Article MariaDB not starting — six-step triage from logs to stale PID How to Troubleshoot MariaDB Not Starting
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

FacebookLike
XFollow
PinterestPin
InstagramFollow

Subscribe Now

Subscribe to our newsletter to get our newest articles instantly!
Most Popular
Display PHP errors — ini_set + php.ini configuration
How to Display PHP Errors
May 10, 2026
PHP convert string to uppercase — strtoupper and mb_strtoupper
How to Convert a String to Uppercase in PHP
May 10, 2026
PHP string to float conversion with cast, regex cleanup, NumberFormatter
How to Convert a String to Float in PHP
May 10, 2026
PHP merge arrays without duplicates — union operator and array_unique
How to Combine Two Arrays Without Duplicates in PHP
May 10, 2026
PHP delete array element — unset, array_splice, array_filter, array_search
How to Delete an Element from a PHP Array
May 10, 2026

You Might Also Like

WordPress disable revision and autosave — wp-config constants and wp_print_scripts dequeue
Web Development

How to Disable Revisions and Autosave in WordPress

8 Min Read
WordPress admin notice — four notice types shown at the top of the admin area
Web Development

How to Show Custom Notifications in the WordPress Dashboard

6 Min Read
Laravel Eloquent multiple where and orWhere — closure-grouped query snippet with parenthesis highlight
Web Development

How to Combine Multiple where() and orWhere() in Laravel Eloquent

7 Min Read
Laravel Eloquent delete record — trash-bin icon next to User::destroy code snippet
Web Development

How to Delete a Record with Laravel Eloquent (4 Methods)

6 Min Read
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Latest News

  • SEO Audit Tool
  • Client ReferralsNew
  • Execution of SEO
  • Reporting Tool

Resouce

  • Google Search Console
  • Google Keyword Planner
  • Google OptimiseHot
  • SEO Spider

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?