How7o
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Reading: How to Restart the MariaDB Server on Linux
Share
How7oHow7o
Font ResizerAa
  • OS
Search
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Follow US
© 2024–2026 How7o. All rights reserved.
How7o > Free Laravel, PHP, WordPress & Server Tutorials > 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.
[mc4wp_form]
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
Most Popular
Set vi as the default editor in Ubuntu — a terminal opening the vim editor
How to Set vi (Vim) as the Default Editor in Ubuntu
June 8, 2026
rsync says ALL DONE but files are missing — a terminal showing ALL DONE next to an empty folder
rsync Says “ALL DONE” but Files Are Missing: How to Verify
June 8, 2026
Migrate a website to a new server with rsync — files copying from an old server to a new one over SSH
How to Migrate a Website to a New Server With rsync
June 8, 2026
Bun runtime — faster JS toolkit replacing npm in Laravel projects
How to Install Bun Runtime on Ubuntu (And Use It in a Laravel Project)
May 24, 2026
Tailscale mesh — peer-to-peer connections between devices, coordination server
How to Install Tailscale on Ubuntu (Zero-Config Mesh VPN for Self-Hosters)
May 24, 2026

You Might Also Like

Remove Files & Folders in Linux
Server Management

How to Remove Files and Folders in Linux Using Command Line (rm, rmdir, unlink)

5 Min Read
Enable CageFS for a user on CloudLinux — cagefsctl CLI and CloudLinux Manager
Server Management

How to Enable CageFS for a User on CloudLinux / cPanel

5 Min Read
Laravel Eloquent count rows — Post::count query snippet with aggregate bar chart icon
Web Development

How to Count Rows in Laravel Eloquent Efficiently

6 Min Read
Laravel DataTables custom column search — filterColumn callback handles the search SQL
Web Development

How to Search Custom or Composite Columns in Laravel DataTables

8 Min Read
How7o

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

Tools

  • Age Calculator
  • Word Counter
  • Image Upscaler
  • Password Generator
  • QR Code Generator
  • See all tools→

Pranks

  • Fake Blue Screen Prank
  • Hacker Typer
  • Fake iMessage Generator
  • Windows XP Crash Prank
  • Windows 11 Update Prank
  • See all prank screens →

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service
  • Sitemap
© 2024–2026 How7o. All rights reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?