Mysql can't start even after reboot - mysql

hello my mysql no more work on my server so I hope to solve it soon.
When I type:
service mysql start
I have the following message:
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
So I look at the first one and:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled)
Active: activating (start-pre) since Mon 2017-04-17 00:08:42 UTC; 1s ago
Process: 24182 ExecStart=/usr/sbin/mysqld --daemonize --pid-
file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Control: 24200 (mysql-systemd-s)
CGroup: /system.slice/mysql.service
└─control
└─24200 /bin/bash /usr/share/mysql/mysql-systemd-start pre
Apr 17 00:08:42 darphus.xen.prgmr.com systemd[1]: mysql.service holdoff time ...
Apr 17 00:08:42 darphus.xen.prgmr.com systemd[1]: Stopping MySQL Community Se...
Apr 17 00:08:42 darphus.xen.prgmr.com systemd[1]: Starting MySQL Community Se...
Apr 17 00:08:42 darphus.xen.prgmr.com mysql-systemd-start[24200]: ls: cannot ...
Apr 17 00:08:42 darphus.xen.prgmr.com mysql-systemd-start[24200]: 2017-04-17T...
Apr 17 00:08:42 darphus.xen.prgmr.com mysql-systemd-start[24200]: 2017-04-17T...
Apr 17 00:08:42 darphus.xen.prgmr.com mysql-systemd-start[24200]: 2017-04-17T...
Hint: Some lines were ellipsized, use -l to show in full.
for :
journalctl -xn
I have:
-- Logs begin at Sun 2017-04-16 23:42:18 UTC, end at Mon 2017-04-17 00:12:52 UTC
Apr 17 00:12:51 darphus.xen.prgmr.com systemd[1]: Starting MySQL Community Serve
-- Subject: Unit mysql.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Apr 17 00:12:51 darphus.xen.prgmr.com mysql-systemd-start[27976]: ls: cannot acc
Apr 17 00:12:51 darphus.xen.prgmr.com mysql-systemd-start[27976]: 2017-04-17T00:
Apr 17 00:12:51 darphus.xen.prgmr.com mysql-systemd-start[27976]: 2017-04-17T00:
Apr 17 00:12:51 darphus.xen.prgmr.com mysql-systemd-start[27976]: 2017-04-17T00:
Apr 17 00:12:52 darphus.xen.prgmr.com postfix/pickup[804]: warning: 1E20F25E72:
Apr 17 00:12:52 darphus.xen.prgmr.com postfix/pickup[804]: 1E20F25E72: uid=0 fro
Apr 17 00:12:52 darphus.xen.prgmr.com postfix/proxymap[809]: warning: mysql:/etc
Apr 17 00:12:52 darphus.xen.prgmr.com postfix/cleanup[27709]: warning: proxy:mys
Apr 17 00:12:52 darphus.xen.prgmr.com postfix/cleanup[27709]: warning: 1E20F25E7
I did a purge of mysql-server mysql-client and mysql-common with autoclean and autoremove. I erased /var/lib/mysql
After I reinstalled and I still have the same problem as at the top of the message.

Related

mysql - failed unable to start

I don't know why this error
Error message:
root#li1714-176:/data/mysql# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysqld; generated)
Active: failed (Result: exit-code) since Wed 2020-03-25 08:47:34 CST; 23min ago
Docs: man:systemd-sysv-generator(8)
Process: 3776 ExecStart=/etc/init.d/mysqld start (code=exited, status=1/FAILURE)
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:52 li1714-176 rsyslogd[588]: action 'action 2' (module 'builtin:omfile') message lost, could not be processed. Check for additional error messa
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:54 li1714-176 sshd[8551]: Failed password for invalid user mk from 170.231.57.142 port 6220 ssh2
Mar 25 09:31:54 li1714-176 sshd[8551]: Received disconnect from 170.231.57.142 port 6220:11: Bye Bye [preauth]
Mar 25 09:31:54 li1714-176 sshd[8551]: Disconnected from invalid user mk 170.231.57.142 port 6220 [preauth]
journalctl -u mysqld.service error:
Mar 25 06:40:19 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 06:40:19 li1714-176 mysqld[751]: Starting MySQL
Mar 25 06:40:21 li1714-176 mysqld[751]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 06:40:21 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:40 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 09:31:40 li1714-176 mysqld[7625]: Starting MySQL
Mar 25 09:31:42 li1714-176 mysqld[7625]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
How to free up more space.
I want to start or extract the database normally
Given rsyslog is complaining about 'No space left on device' I suspect that mysql will have the same problem. It needs space to work as well.
journalctl -u mysqld.service
to see mysql errors, though it is probably also having limited recording due to out of space.
Fix the amount of free space on your storage and make all your programs happy.

MySQL 5.7.27 can’t start

I just installed MySQL 5.7.23 on Centos 7. As soon as I do systemctl start mysqld gives me an error. Making systemctl status mysqld returns:
●�mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
���Active: failed�(Result: start-limit) since Tue 2019-08-27 02:55:20 CEST; 11min ago
�����Docs: man:mysqld(8)
���������http://dev.mysql.com/doc/refman/en/using-systemd.html
��Process: 11299 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
��Process: 11281 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service: control process exited, code=exited status=1
Aug 27 02:55:20 server0-centos7 systemd[1]: Failed to start MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: Unit mysqld.service entered failed state.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service failed.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service holdoff time over, scheduling restart.
Aug 27 02:55:20 server0-centos7 systemd[1]: Stopped MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: start request repeated too quickly for mysqld.service
Aug 27 02:55:20 server0-centos7 systemd[1]: Failed to start MySQL Server.
Aug 27 02:55:20 server0-centos7 systemd[1]: Unit mysqld.service entered failed state.
Aug 27 02:55:20 server0-centos7 systemd[1]: mysqld.service failed.
There can be various reasons for this issue.
Required folder permissions may not be there.
Please find the answer related to folder permission here.
Job for mysqld.service failed in Centos 7
You may have less RAM free with the MySQL service stopped, so as soon as you run:
systemctl start mysqld
MySQL is attempting to utilize more than what’s available and since it’s unable to do so, it fails.
For database-driven websites, I recommend at least 1GB of RAM minimum. if you still want to run with less MB of RAM then I’d recommend NGINX over Apache.

I tried to reinstall MySQL on centos and now it doesn't start

I tried to reinstall MySQL and now it doesn't even start, and if I go to "messages" it says this
Jul 23 11:04:27 systemd: Starting MySQL Server...
Jul 23 11:04:29 systemd: mysqld.service: main process exited, code=exited, status=1/FAILURE
Jul 23 11:04:29 systemd: Failed to start MySQL Server.
Jul 23 11:04:29 systemd: Unit mysqld.service entered failed state.
Jul 23 11:04:29 systemd: mysqld.service failed.

Unable to start mysql in ubuntu

I have tried the following the code to restart the MySql services
sudo service mysql restart
got the following error
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
ubuntu#ip-172-31-52-10:~$ journalctl -xe
And the journalctl Log says
Unit mysql.service has begun starting up.
Mar 17 15:10:55 ip-172-31-52-10 audit[4057]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=4057 comm="mysqld" r
Mar 17 15:10:55 ip-172-31-52-10 kernel: audit: type=1400 audit(1552835455.957:54): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/syst
Mar 17 15:10:56 ip-172-31-52-10 mysql-systemd-start[4038]: ERROR: Unable to start MySQL server:
Mar 17 15:10:56 ip-172-31-52-10 mysql-systemd-start[4038]: 2019-03-17T15:10:56.000286Z 0 [ERROR] unknown variable 'bind=0.0.0.0'
Mar 17 15:10:56 ip-172-31-52-10 mysql-systemd-start[4038]: 2019-03-17T15:10:56.004319Z 0 [ERROR] Aborting
Mar 17 15:10:56 ip-172-31-52-10 mysql-systemd-start[4038]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Mar 17 15:10:56 ip-172-31-52-10 mysql-systemd-start[4038]: Once the problem is resolved, restart the service.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Control process exited, code=exited status=1
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has finished shutting down.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Start request repeated too quickly.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 17 15:10:56 ip-172-31-52-10 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
how do I fix this?

Express.JS app is conflicting with mysql server

I'm having a bad day trying to find the reason why this bug is occurring to me.
when I run the express.js app (using pm2) it makes MySQL 5.7 server stop and when I try to restart the MySQL server it outputs an error.
Bear in mind that the express.js app is running on port 80 and MySQL is running on port 3306. and that the express.js app is not trying to talk or connect to MySQL in any ways so they shouldn't interact with each other.
Platform: Digital Ocean, OS: Ubuntu 16.04, Node Version: 8.2.1, MySQL
Version: 5.7
`journalctl -xe` output :
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit mysql.service has begun starting up. Aug 07 19:37:35 ubuntu-512mb-lon1-01 systemd[1]: mysql.service: Main process exited,
code=exited, status=1/FAILURE Aug 07 19:37:49 ubuntu-512mb-lon1-01
sshd[20843]: Invalid user db2fenc1 from xxxxxx Aug 07 19:37:49
ubuntu-512mb-lon1-01 sshd[20843]: input_userauth_request: invalid user
db2fenc1 [preauth] Aug 07 19:37:49 ubuntu-512mb-lon1-01 sshd[20843]:
pam_unix(sshd:auth): check pass; user unknown Aug 07 19:37:49
ubuntu-512mb-lon1-01 sshd[20843]: pam_unix(sshd:auth): authentication
failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxx. Aug 07
19:37:51 ubuntu-512mb-lon1-01 sshd[20843]: Failed password for invalid
user db2fenc1 from xxxxxx port 60654 ssh2 Aug 07 19:37:51
ubuntu-512mb-lon1-01 sshd[20843]: Received disconnect from xxxxx port
60654:11: Normal Shutdown, Thank you for playing [preau Aug 07
19:37:51 ubuntu-512mb-lon1-01 sshd[20843]: Disconnected from xxxxx
port 60654 [preauth] Aug 07 19:38:05 ubuntu-512mb-lon1-01 systemd[1]:
Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit mysql.service has failed.
-- The result is failed. Aug 07 19:38:05 ubuntu-512mb-lon1-01 systemd[1]: mysql.service: Unit entered failed state. Aug 07 19:38:05
ubuntu-512mb-lon1-01 systemd[1]: mysql.service: Failed with result
'exit-code'. Aug 07 19:38:05 ubuntu-512mb-lon1-01 systemd[1]:
mysql.service: Service hold-off time over, scheduling restart. Aug 07
19:38:05 ubuntu-512mb-lon1-01 systemd[1]: Stopped MySQL Community
Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit mysql.service has finished shutting down. Aug 07 19:38:05 ubuntu-512mb-lon1-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit mysql.service has begun starting up. Aug 07 19:38:05 ubuntu-512mb-lon1-01 systemd[1]: mysql.service: Main process exited,
code=exited, status=1/FAILURE
Could you provide the logs from mysql logs? if it's using the default settings, it will be in /var/log/mysq/