Error:mysqld.service: Start request repeated too quickly. On manjaro
Asked Answered
N

6

13

Yesterday I updated my manjaro. I had many problems since then.

Firstly, I type

systemctl status mysqld.service

to start MySQL, but it errors out with

mysqld.service: Start request repeated too quickly.

I has found many suggestions but they doesn't work.

I already have tried:

  • Check the permission of the MySQL data directory using the below command. The ownership should be mysql:mysql and the directory permission should be 700.

    ls -ld /var/lib/mysql/
    
  • Check the permission of databases inside the MySQL data directory using the below command. The ownership should be mysql:mysql for all the files inside that directory.

    ls -lh /var/lib/mysql/
    
  • Check the listening network TCP ports using the command

    netstat -ntlp
    
  • Check the MySQL log files for any error using:

    cat /var/log/mysql/mysqld.log
    
  • Try to start MySQL using

    mysqld_safe --defaults-file=/etc/my.cf
    

My Error:

dong@dong-manjaro  /home/dong   systemctl status mysqld.service                                                                          13:30:33 
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2019-08-22 13:30:29 CST; 6s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 8006 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
  Process: 8027 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS (code=exited, status=127)
 Main PID: 8027 (code=exited, status=127)

8月 22 13:30:29 dong-manjaro systemd[1]: mysqld.service: Service RestartSec=100ms expired, scheduling restart.
8月 22 13:30:29 dong-manjaro systemd[1]: mysqld.service: Scheduled restart job, restart counter is at 5.
8月 22 13:30:29 dong-manjaro systemd[1]: Stopped MySQL Server.
8月 22 13:30:29 dong-manjaro systemd[1]: **mysqld.service: Start request repeated too quickly.**
8月 22 13:30:29 dong-manjaro systemd[1]: **mysqld.service: Failed with result 'exit-code'.**
8月 22 13:30:29 dong-manjaro systemd[1]: **Failed to start MySQL Server.**
Nap answered 22/8, 2019 at 6:39 Comment(1)
Wait, Wait,WaitNap
M
14

I have faced same issue and solved this problem like that:

if /var/log/mysql folder not exists:

sudo mkdir /var/log/mysql

and then give permission this folder:

sudo chown -R mysql:mysql /var/log/mysql

sudo systemctl stop mysql

sudo systemctl start mysql
Macaco answered 13/9, 2021 at 6:5 Comment(3)
the best so farGamecock
/var/log/mysql should probably be /var/lib/mysqlParquetry
man you saved my life, bravo for such simple solutionLocker
G
4

Ran into similar issue.Follow steps(Sql server Version: '8.0.22-0ubuntu0.20.04.3')

 1. Edit file: mysqld.cnf under directory: /etc/mysql/mysql.conf.d
 2. Ensure that below basic settings are made in file mysqld.cnf and save it.
 # * Basic Settings
 user       = mysql
 pid-file   = /var/run/mysqld/mysqld.pid
 socket     =   /var/run/mysqld/mysqld.sock
 port       = 3306
 datadir    = /var/lib/mysql
 # setting for localhost
 bind-address       = 127.0.0.1
 mysqlx-bind-address    = 127.0.0.1
 log_error = /var/log/mysql/error.log
 server-id      = 1
 log_bin            = /var/log/mysql/mysql-bin.log
 max_binlog_size    = 100M
 3. Check error log files under directory: /var/log/mysql 
 4. Remove all log files: Cd /var/log/mysql $ sudo rm -R error*
 5. Start mysql server: $ sudo systemctl start mysql.service
 6. Check status of mysql server: $ sudo systemctl status mysql.service
Ghiberti answered 12/12, 2020 at 8:22 Comment(0)
M
4

I fixed like this:

sudo chown -R mysql:mysql /var/lib/mysql

sudo systemctl start mysql
Maidenhead answered 15/3, 2022 at 20:31 Comment(0)
B
2

For us, it was to chown the logfile:

[root@tree ~]# ls -alh /var/log/mysqld.log 
-rw-r----- 1 root logs 8.3K Apr 20 02:17 /var/log/mysqld.log
[root@tree ~]# chown mysql: /var/log/mysqld.log 
[root@tree ~]# systemctl start mysqld
[root@tree ~]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-04-20 15:32:01 UTC; 20s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 28339 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 28313 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 28342 (mysqld)
   Memory: 43.3G
   CGroup: /system.slice/mysqld.service
           └─28342 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Got rid of the same failure.

Bonfire answered 20/4, 2021 at 15:36 Comment(0)
F
1

I dealt with the same problem on Ubuntu 22.04.

You need to make the mysql user the owner of datadir and log_error directories by executing:

sudo chown -R mysql /var/lib/mysql /var/log/mysql

Path to directories may differ. You can find appropriate paths at configuration file, which is located at: /etc/mysql/mysql.conf.d/mysqld.cnf

Farad answered 21/3, 2023 at 10:42 Comment(0)
W
0

My fix was to comment one line (binlog_expire_logs_seconds=259200) in /etc/mysql/my.cnf . It was pointed out to me by running

mysqld --verbose --help

when I've got:

mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 22.
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Wareroom answered 17/7, 2023 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.