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.
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
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.
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:
#1 Best Overall
- 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 mysqlsudo systemctl start mysql |
| RPM-based MySQL installation | mysqld.service |
sudo systemctl status mysqldsudo 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.
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.
Rank #2
Step 2: discover the unit instead of guessing
On a system using systemd, list installed unit files whose names contain the likely database products:
Recommended Free Tools
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.
Rank #3
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.
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 →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.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRepair 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.
Best Value
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:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →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.
A safe decision sequence
- Run
cat /etc/os-releaseand note the distribution. - Run
systemctl list-unit-files | grep -Ei 'mysql|maria|mysqld'. - Choose the exact discovered unit: commonly
mysql,mysqld, ormariadb. - Run
sudo systemctl status <unit>before starting or changing configuration. - If the unit is inactive, run
sudo systemctl start <unit>, then check status again. - If the unit is absent, verify the server package and inspect
/etc/init.dfor a legacy script. - If the unit fails, run
sudo journalctl -u <unit> -n 100 --no-pagerand fix the first reported cause. - 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.
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.




