Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Job for mysqld.service failed See "systemctl status mysqld.service"

Console says

[root@ip-172-31-18-2 mysql]# service mysqld start Starting mysqld (via systemctl):  Job for mysqld.service failed because the control process exited with an error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. 

mysqld.service

[root@ip-172-31-18-2 mysql]# systemctl status mysqld.service ● mysqld.service - SYSV: MySQL database server.    Loaded: loaded (/etc/rc.d/init.d/mysqld)    Active: failed (Result: exit-code) since Sat 2017-02-18 20:59:17 IST; 36s ago      Docs: man:systemd-sysv-generator(8)   Process: 9925 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)  Feb 18 20:59:16 ip-172-31-18-2.ap-southeast-1.compute.internal systemd[1]: Starting SYSV: MySQL database server.... Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal mysqld[9925]: MySQL Daemon failed to start. Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal mysqld[9925]: Starting mysqld:  [FAILED] Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal systemd[1]: mysqld.service: control process exited, code=exited status=1 Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal systemd[1]: Failed to start SYSV: MySQL database server.. Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state. Feb 18 20:59:17 ip-172-31-18-2.ap-southeast-1.compute.internal systemd[1]: mysqld.service failed. 

What I have tried until now:

mysqld_safe --defaults-file=/etc/my.cf  chown -R mysql:mysql /var/lib/mysql  /etc/init.d/mysqld start   /etc/init.d/mysqld stop  systemctl restart systemd-logind 

rebooted the server

Still no luck.

my.cnf file

# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html  [mysqld] # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for a dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock  # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0  log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 
like image 433
Nobi Avatar asked Feb 18 '17 15:02

Nobi


People also ask

Can't connect to local MySQL server through?

normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.


1 Answers

This amazingly worked.

/etc/init.d/mysql stop service mysql stop killall -KILL mysql mysqld_safe mysqld /etc/init.d/mysql start service mysql start 
like image 59
Yemi Orokotan Avatar answered Sep 23 '22 06:09

Yemi Orokotan