How7oHow7o
  • Home
  • Tools
    • All Tools
    • Image Tools
    • Text & String Tools
    • Video Tools
    • Developer Tools
    • PDF Tools
    • Calculators & More
  • Prank Screens
  • Learn
  • Blog
  • Contact
Reading: How to Restart the MariaDB Server on Linux
Share
Notification Show More
Font ResizerAa
How7oHow7o
Font ResizerAa
  • Tools
  • Prank Screens
  • Learn
  • Blog
Search
  • Home
  • Tools
    • All Tools
    • Image Tools
    • Text & String Tools
    • Video Tools
    • Developer Tools
    • PDF Tools
    • Calculators & More
  • 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.

You Might Also Like

mysqldump all databases — export and import commands
Server Management

How to Export and Import All MySQL Databases at Once

6 Min Read
Nginx 502 with recv() failed 104 connection reset — PHP-FPM timeout and memory tuning
Server Management

Fix Nginx ‘recv() failed (104: Connection reset by peer)’ with FastCGI

9 Min Read
Nginx as a reverse proxy for a Node.js app on Ubuntu
Server Management

How to Set Up Nginx as a Reverse Proxy for Node.js on Ubuntu

11 Min Read
WordPress $wpdb->insert_id — read after $wpdb->insert or $wpdb->query INSERT
Web Development

How to Retrieve the Last Inserted Row ID in WordPress

7 Min Read
How7oHow7o

Free browser-based tools, prank screens, and step-by-step tech tutorials. No signup, nothing uploaded.

  • Private by design — your files never leave your device
  • Instant — no signup, no install, no waiting
  • Always free — no trials, no watermarks, no paywalls

Tools

  • PDF Editor
  • Image Upscaler
  • JPEG Compressor
  • Password Generator
  • QR Code Generator
  • Video Trimmer
  • See all tools →

Pranks

  • Cracked Screen Prank
  • Fake Blue Screen (BSOD)
  • Fake Console Update Screen
  • Fake Disk Format
  • Fake Low Battery
  • Fake Virus Scan
  • 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?