Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk8 min

Fixing the “mysqld: Unrecognized Service” Error on Linux

The mysqld executable is not always the service name. Learn how to identify the installed MySQL or MariaDB unit, start it safely, and diagnose missing or failed services on Linux.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: the command is usually using the daemon name instead of the service unit name installed by your distribution. Debian and Ubuntu commonly provide mysql.service; RPM-based systems commonly provide mysqld.service. Discover the unit on your machine, then use that exact name with systemctl or the legacy service command.

What “unrecognized service” actually means

When Linux prints mysqld: unrecognized service, the service manager cannot find a service registered under the name mysqld. It does not necessarily mean that MySQL is missing, corrupted, or unable to start.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

mysqld is the name of the MySQL server daemon executable. The name used by the service manager is chosen by the package and distribution. Oracle’s MySQL documentation uses mysqld.service for RPM installations, while Debian-based and SUSE Linux Enterprise Server (SLES) installations may use mysql.service. Older SysV init scripts can also be named either mysql or mysqld.

Therefore, changing only the command’s service name is often enough:

  • Debian or Ubuntu: try sudo systemctl start mysql.
  • RPM-family systems such as RHEL, CentOS, Fedora, and many Oracle Linux installations: try sudo systemctl start mysqld.
  • If MariaDB is installed, the unit is commonly mariadb, not either MySQL name.

Do not create a hand-written mysqld.service just to suppress the message. First identify the package and the unit it installed.

Use the installed service name, not a guessed one

Installation family Common unit name Typical commands
Debian or Ubuntu package mysql.service sudo systemctl status mysql
sudo systemctl start mysql
RPM-based MySQL installation mysqld.service sudo systemctl status mysqld
sudo systemctl start mysqld
MariaDB package mariadb.service (commonly) Use the discovered mariadb unit and its documentation.
Legacy SysV installation mysql or mysqld sudo service mysql start or sudo service mysqld start, matching the script in /etc/init.d.

These are common names, not guarantees. A vendor package, an older release, or a locally rebuilt server can use a different unit. The discovery commands below are authoritative for the machine you are repairing.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 1: identify the Linux distribution and package family

Start by checking the operating-system metadata rather than assuming that a tutorial’s command applies to your host:

cat /etc/os-release

Look for fields such as ID=ubuntu, ID=debian, ID=fedora, ID=rhel, or ID=centos. Debian-family systems normally use APT and RPM-family systems normally use DNF or YUM, but the distribution ID is more useful than the package-manager command when choosing the service name.

Next, inspect installed packages with the package manager already used on that machine. Confirm whether the server package is MySQL, MariaDB, or only a client package. A client package can provide commands such as mysql without installing a database server or a service unit.

Step 2: discover the unit instead of guessing

On a system using systemd, list installed unit files whose names contain the likely database products:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl list-unit-files | grep -Ei 'mysql|maria|mysqld'

Then check units currently loaded or known to systemd, including inactive ones:

systemctl list-units --all | grep -Ei 'mysql|maria|mysqld'

These commands may show entries such as mysql.service, mysqld.service, or mariadb.service. Remove the .service suffix when passing the name to most systemctl commands; both forms are accepted, but using the displayed spelling avoids confusion.

If the search returns multiple database units, do not start one at random. Determine which product your application is configured to use, and inspect each unit’s status before making changes.

Step 3: start MySQL on Debian and Ubuntu

Check the unit

sudo systemctl status mysql

A healthy but stopped installation normally reports that mysql.service is loaded and inactive. If the output says the unit could not be found, return to unit discovery and package verification; the problem is not a startup failure yet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start it now

sudo systemctl start mysql

Verify the result:

sudo systemctl status mysql

Start it automatically after boot

sudo systemctl enable mysql

Ubuntu documentation also shows the equivalent restart forms:

sudo systemctl restart mysql.service
sudo service mysql restart

The service command is a compatibility interface. On a current Ubuntu system it generally delegates to systemd, while on an older installation it may invoke a SysV script directly.

Step 4: start MySQL on RPM-based distributions

Check the RPM unit

sudo systemctl status mysqld

Oracle’s MySQL installation instructions for RPM packages use mysqld.service. If this command reports that the unit is missing, verify that the server package—not only a client or connector package—was installed.

Start and enable the server

sudo systemctl start mysqld
sudo systemctl enable mysqld

Check status again after starting. A successful start should show an active running state. If systemd reports a failure, use the journal procedure in the next section instead of repeatedly issuing start.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 5: distinguish an absent unit from a failed unit

These two states require different fixes:

What you see What it means Next action
Unit mysql.service could not be found (or the equivalent for mysqld) No unit with that name is installed or visible to systemd. Discover other names, verify the server package, and check whether MariaDB is installed.
The unit is loaded but exits or enters a failed state The service exists; startup reached a configuration, permission, storage, or data-directory error. Read systemctl status and the unit-specific journal.
The command says “unrecognized service” The legacy service interface could not find a script with that name. Use the exact script or systemd unit name shown by discovery.

A binary named mysqld can exist even when no service unit has been installed. On Ubuntu, for example, the mysqld daemon is supplied by the mysql-server-core-8.0 package, but the presence of that binary alone does not prove that the complete server package and its service integration are present.

When the installed product is MariaDB

Some distributions provide MariaDB as the default MySQL-compatible server. Its daemon and service integration are packaged separately from Oracle MySQL, and the unit is commonly mariadb.service. Discover it with:

systemctl list-unit-files | grep -Ei 'mysql|maria|mysqld'

If mariadb.service is the installed unit, use:

sudo systemctl status mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Do not install a second server merely because a tutorial uses a different name. Running competing database servers can create port conflicts, separate data directories, and uncertainty about which server your application is contacting.

When no MySQL or MariaDB unit appears

Verify the server package

Use the package manager’s installed-package query to look for a server package. On Debian or Ubuntu, package names commonly contain mysql-server; on RPM systems, names may contain mysql-server or be supplied by a vendor repository. Exact package names vary by release and repository, so use the package search and installed-package output rather than copying a version-specific name blindly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Repair an incomplete installation

If the package database shows an interrupted or incomplete installation, finish the distribution’s package configuration, repair dependency errors, and reinstall the server package from the configured repository. Then repeat unit discovery. Installing a daemon binary manually or copying an init script from another release can leave systemd without the metadata needed to manage the server.

Check for a legacy init script

ls -l /etc/init.d/ | grep -Ei 'mysql|maria|mysqld'

If a script is present, its filename is the name expected by the legacy command. For example, a file named /etc/init.d/mysql is invoked with sudo service mysql start, not sudo service mysqld start. On a system that has moved to systemd, the script may be wrapped automatically; the unit listing remains the better source of truth.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Read the journal when the unit exists but will not start

An “unrecognized service” error is solved by finding the name. A recognized unit that fails is a separate troubleshooting case. First capture the concise status output:

sudo systemctl status mysql

Substitute mysqld or mariadb when that is the installed unit. Then read recent logs for that exact unit. Canonical’s Ubuntu Server documentation recommends:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo journalctl -u mysql -n 100 --no-pager

For an RPM installation, use:

sudo journalctl -u mysqld -n 100 --no-pager

Look for the first meaningful error, not only the final “failed” line. Typical categories include an invalid option in the configuration file, an unavailable port, incorrect ownership of the data directory, insufficient disk space, a missing directory, or a database recovery error. Correct the specific cause shown in the log, then restart the same unit and inspect status again.

Use the correct command for the service manager

Environment Preferred command Notes
systemd sudo systemctl start <unit> Use the unit discovered by list-unit-files.
Legacy SysV init sudo service <script> start Use the filename under /etc/init.d.
Mixed compatibility system Either interface may work Prefer systemctl when a native unit is present; do not assume both names are interchangeable.

Oracle’s manual explicitly notes that the alternative service command must use the appropriate service name when it is not mysqld. In other words, replacing systemctl with service does not remove the naming issue.

Change systemd settings without replacing the vendor unit

If you need to add a resource limit, environment setting, or another systemd override, edit the existing unit rather than creating a duplicate service file. MySQL documents these commands:

sudo systemctl edit mysql      # Debian or Ubuntu
sudo systemctl edit mysqld     # RPM platforms
sudo systemctl daemon-reload
sudo systemctl restart mysql   # or mysqld, matching the installed unit

An override belongs to the unit that actually exists. Running systemctl edit mysqld on a host that provides only mysql.service creates no useful configuration for the running server and can mislead future troubleshooting. After saving an override, reload systemd and restart the matching unit, then verify status and the journal.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A safe decision sequence

  1. Run cat /etc/os-release and note the distribution.
  2. Run systemctl list-unit-files | grep -Ei 'mysql|maria|mysqld'.
  3. Choose the exact discovered unit: commonly mysql, mysqld, or mariadb.
  4. Run sudo systemctl status <unit> before starting or changing configuration.
  5. If the unit is inactive, run sudo systemctl start <unit>, then check status again.
  6. If the unit is absent, verify the server package and inspect /etc/init.d for a legacy script.
  7. If the unit fails, run sudo journalctl -u <unit> -n 100 --no-pager and fix the first reported cause.
  8. Only after the correct unit is confirmed, use sudo systemctl enable <unit> to start it automatically at boot.

This sequence prevents the most common mistake: treating a naming mismatch as a database configuration problem. The daemon name, package name, init-script name, and systemd unit name can be related without being identical, so the installed unit—not a copied command—is the reliable answer.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.