What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The error usually means you used the daemon name as the service name, but your Linux package installed a differently named service unit. MySQL commonly uses mysql.service on Debian-based systems (and SLES) and mysqld.service on RPM-based systems. Discover the unit installed on your machine, then use that exact name with systemctl or the legacy service command.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What “unrecognized service” actually means
mysqld is the name of the MySQL server daemon. It is not guaranteed to be the name registered with the operating system’s service manager. Distribution packaging determines whether the service is exposed as mysql.service, mysqld.service, or, when MariaDB is installed, mariadb.service.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
The message is different from a startup failure. “Unrecognized service” means the command could not find a service with the name you supplied. If a unit is found but the server will not start, you have a second problem—usually configuration, permissions, data-directory, port, or storage related—that must be diagnosed from the unit status and journal.
The Oracle MySQL Reference Manual documents mysqld.service for RPM installations and says to use mysql instead of mysqld on Debian-based and SLES systems. Legacy init scripts can follow the same naming split.
#1 Best Overall
Use the installed unit name, not a guessed one
| Installation or platform | Common unit name | Typical commands | Important qualification |
|---|---|---|---|
| Ubuntu or Debian MySQL packages | mysql.service |
sudo systemctl status mysqlsudo systemctl start mysql |
The executable may still be mysqld; the manager name is commonly mysql. |
| SLES MySQL installation | mysql.service |
sudo systemctl status mysqlsudo systemctl start mysql |
Use the unit actually installed if your package differs. |
| RPM-based MySQL installation, such as RHEL, CentOS, or Fedora | mysqld.service |
sudo systemctl status mysqldsudo systemctl start mysqld |
This is the unit name used by MySQL’s RPM installation guidance. |
| MariaDB package | mariadb.service |
sudo systemctl status mariadbsudo systemctl start mariadb |
Use MariaDB’s unit and documentation rather than forcing a MySQL unit name. |
| Older SysV init installation | mysql or mysqld |
sudo service mysql start or sudo service mysqld start |
The script name is determined by the file in /etc/init.d. |
Find the correct service in a few commands
Do not edit configuration or create a replacement unit until you know which distribution, server product, and service manager are present. Run the following sequence as a normal user; use sudo only for the status or control commands that require it.
-
Identify the operating system
cat /etc/os-releaseThis shows whether the host is Debian-based, RPM-based, SLES, or another distribution. The package family is a useful clue, but it is not proof of the unit name because repositories and third-party packages can change names.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
List installed service definitions
systemctl list-unit-files | grep -Ei 'mysql|maria|mysqld' systemctl list-units --all | grep -Ei 'mysql|maria|mysqld'The first command searches installed unit files, including units that are disabled or not currently running. The second includes loaded, inactive, and failed units. Together they reveal names that a simple status check might miss.
-
Check the matching unit before starting it
On Ubuntu or Debian, try:
sudo systemctl status mysqlOn an RPM-based MySQL installation, try:
sudo systemctl status mysqldIf the listing shows MariaDB, check
mariadbinstead. A successful status lookup confirms that the service manager recognizes the name, even if the unit is currently stopped.Rank #2
-
Start the unit you found
sudo systemctl start mysql # Debian/Ubuntu example sudo systemctl start mysqld # RPM-based MySQL example sudo systemctl start mariadb # MariaDB exampleRun only the command matching the unit discovered on your machine. A comment in a shell example is not a substitute for checking the actual listing.
-
Enable it at boot only after a successful start
sudo systemctl enable mysql sudo systemctl enable mysqldEnable the matching unit, not both. Enabling the wrong name either reproduces the error or leaves the database disabled at boot.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Ubuntu and Debian: use mysql when that unit exists
On a standard Ubuntu or Debian MySQL server package, the service-manager name is commonly mysql. These commands follow the naming used in Canonical’s Ubuntu Server documentation:
sudo systemctl status mysql
sudo systemctl start mysql
sudo systemctl restart mysql.service
sudo service mysql start
sudo service mysql restart
The optional .service suffix is accepted by systemd, so mysql and mysql.service identify the same unit. The legacy service wrapper also requires the script or unit name that your package installed; changing only the command from systemctl to service does not make mysqld valid on a host that provides only mysql.
Rank #3
RHEL, CentOS, Fedora and other RPM systems: check mysqld
MySQL’s RPM installation instructions use mysqld.service. On those installations, the normal control commands are:
sudo systemctl status mysqld
sudo systemctl start mysqld
sudo systemctl enable mysqld
sudo journalctl -u mysqld -n 100 --no-pager
Do not assume every RPM-based host uses the same database product. If the discovery commands return mariadb.service, use mariadb and consult the MariaDB package’s service documentation. A distribution upgrade or a repository change can also alter which package is installed, so discovery is safer than relying on the operating system name alone.
If no MySQL or MariaDB unit appears
The server package may be absent
A client package can be installed without the server. Likewise, a server executable can be present without a correctly registered unit if installation was interrupted or files were removed. Verify that the server package—not only a client or development package—is installed with your distribution’s package manager. If it is missing or incomplete, install or repair the server package from the distribution repository, then repeat the unit-discovery commands.
The executable name does not prove a unit exists
Ubuntu’s package documentation identifies mysqld as the server daemon supplied by mysql-server-core-8.0. Finding that executable, or seeing it in a process list, does not guarantee that a unit named mysqld.service exists. The service file may be named mysql.service, may not have been installed, or may belong to a different package.
MariaDB may be the installed server
Some distributions provide MariaDB as the default MySQL-compatible server. Search for mariadb as well as mysql and mysqld. Starting a nonexistent MySQL unit will never launch a MariaDB installation; use the product and unit that the package manager installed.
The host may be using legacy SysV scripts
On older systems, inspect /etc/init.d for a script named mysql or mysqld. The command must match that filename:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →sudo service mysql start
sudo service mysqld start
Modern systemd systems can provide compatibility for SysV scripts, but the available names still come from the installed scripts. Do not create a new systemd file merely because a legacy script has a different name.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When the unit exists but startup fails
If systemctl status finds the unit and reports failed, inactive, or an unsuccessful start attempt, stop treating it as an “unrecognized service” problem. Read the unit-specific journal first. Ubuntu recommends:
Best Value
sudo journalctl -u mysql -n 100 --no-pager
Substitute mysqld or mariadb for the unit installed on your host:
sudo journalctl -u mysqld -n 100 --no-pager
sudo journalctl -u mariadb -n 100 --no-pager
Also capture the complete status output:
sudo systemctl status mysql
sudo systemctl status mysqld
Look for the first concrete error in the journal rather than repeatedly issuing start. Typical messages point to a damaged or unavailable data directory, a syntax error in configuration, a permission problem, an occupied network port, insufficient disk space, or a security-policy denial. Those are service-startup faults; changing the service name will not fix them.
Changing systemd settings safely with an override
If you need to adjust a vendor unit, use a systemd drop-in rather than editing the package-owned unit file. MySQL documents the unit-specific commands:
sudo systemctl edit mysql # Debian/Ubuntu
sudo systemctl edit mysqld # RPM platforms
sudo systemctl daemon-reload
sudo systemctl restart mysql # or mysqld, matching the installed unit
Use the same unit name in all four commands. After saving the override, daemon-reload makes systemd read the changed configuration, and the restart tests it. If the restart fails, inspect the corresponding journal immediately.
What not to do
- Do not create a hand-written
mysqld.servicejust to suppress the message. First confirm the package and intended unit. A custom unit can conflict with vendor packaging, duplicate startup logic, or hide an incomplete installation. - Do not start both MySQL and MariaDB units to see which works. They can compete for the same data directory or network port. Identify the installed product first.
- Do not confuse a binary with a service. The daemon executable and service-manager unit are related but independently named packaging objects.
- Do not use
enableas a repair step. Enabling controls boot-time activation; it does not resolve a missing unit or a startup error.
A decision checklist
- If the command says “unrecognized service,” run both unit-listing searches and copy the exact matching name.
- If the matching name is
mysql, usesystemctl start mysqlorservice mysql start. - If it is
mysqld, use the corresponding RPM-style commands. - If it is
mariadb, follow MariaDB’s unit and documentation. - If no unit appears, verify the server package and whether installation completed.
- If a unit appears but fails, use
systemctl statusandjournalctl -u <unit>; investigate that reported error instead of renaming services.
Bottom line for this error
The reliable fix is to discover the service unit installed by your package and use that name consistently. Debian-based MySQL installations commonly expose mysql.service; RPM-based MySQL installations commonly expose mysqld.service; MariaDB commonly exposes mariadb.service. Once the unit is identified, the distinction between “unit not found” and “unit found but failed” tells you whether to repair package installation or troubleshoot the database startup itself.
Quick Recap
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.




