mysqld.service refuses to start: start request repeated too quickly
mysqld.service: Start request repeated too quickly.Short answer
This message only says systemd gave up after several failed starts. The cause is in the lines before it. Read the unit journal and the MySQL error log, fix what they name (usually an uninitialised or wrongly owned data directory, or an unwritable log), then clear the counter with systemctl reset-failed and start again.
Fix it fast
1Find out which cause you have
Read the newest journal lines for the unit. The first failure, above the start-limit line, is the real error. Use the unit name your system has: mysqld on RPM and Arch-style systems, mysql on Debian and Ubuntu.
sudo journalctl -u mysqld -b -n 802Match what you see, then jump to its fix
- 1
The log shows the server stopping straight after start, and /var/lib/mysql is empty or has no mysql schemaThe data directory was never initialisedFix - 2
Permission denied lines for files under the data directory, usually after a restore or copy done as rootThe data directory belongs to the wrong userFix - 3
The log-error path is outside /var/log/mysql*.log (RPM) or /var/log/mysql/*.log (Debian) and the service fails at onceThe error log file cannot be created or writtenFix
- 1
What does the error look like?
mysqld.service: Start request repeated too quickly.systemctl status mysqld shows the unit as failedsystemctl start mysqld fails again straight away
Cause 1 of 3
The data directory was never initialised
1Check
Some packages do not create the data directory contents on install. The MySQL manual says the data directory is created by running mysqld with --initialize, and that on RPM platforms an empty data directory is initialised at startup by the service.
sudo ls -la /var/lib/mysql | head2Fix
With the service stopped, initialise the directory as the mysql user. Note the generated root password in the output. The command aborts if the directory is not empty, so move any broken contents aside first (keep them until you are sure there is nothing to recover).
sudo mysqld --initialize --user=mysql3Verify
Clear the start limit and start the service.
sudo systemctl reset-failed mysqld
sudo systemctl start mysqld
systemctl status mysqld --no-pagerConfirmed by dev.mysql.com
Cause 2 of 3
The data directory belongs to the wrong user
1Check
The manual says the database directories and files must be owned by the mysql login account so the server can read and write them later.
sudo ls -ld /var/lib/mysql && sudo find /var/lib/mysql ! -user mysql | head2Fix
Give the tree back to the mysql user. If you moved the data directory, make sure the datadir option points at the new place and AppArmor on Debian-based systems allows it.
sudo chown -R mysql:mysql /var/lib/mysql3Verify
Clear the counter and start again.
sudo systemctl reset-failed mysqld
sudo systemctl start mysqldConfirmed by dev.mysql.com
Cause 3 of 3
The error log file cannot be created or written
1Check
The startup helper only creates the error log itself for those default patterns. For any other path the file must already exist and be writable by the user running mysqld.
sudo grep -R "log-error" /etc/my.cnf /etc/my.cnf.d /etc/mysql 2>/dev/null2Fix
Create the file and give it to the mysql user, or point log-error back to a default location.
sudo touch /var/log/mysqld-custom.log
sudo chown mysql:mysql /var/log/mysqld-custom.log3Verify
Start the service.
sudo systemctl start mysqld && systemctl is-active mysqldConfirmed by dev.mysql.com
How do I stop it coming back?
- Run systemctl status and journalctl after every config change, before restarting more than once.
- Keep the data directory and any custom log files owned by the mysql user.
- Remember that every start counts toward the systemd limit, including manual ones; stop retrying and read the log after the first failure.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
MySQL start fails with: the server quit without updating the PID file
Can't start server: Bind on TCP/IP port: Address already in use
This message is only a symptom: mysqld started and exited before it wrote its PID file.
3 causes, each with a fixDatabases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
An EC2 instance cannot reach its RDS database
Could not open connection to the host, on port <port>: Connect failed
RDS denies all access until a security group allows it.
3 causes, each with a fixDatabases
Locked out of a fresh MariaDB install as root on Mac or Linux
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
A fresh MariaDB root account is not a normal password account.
3 causes, each with a fixDatabases
An Aria table fails with 'Read page with wrong checksum' (error 1030, code 176)
ERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria
Code 176 means MariaDB's Aria engine read a data or index page whose checksum does not match, so that table file is damaged.
3 causes, each with a fix