I'm trying to access PHPMyAdmin in my localhost, but when I write down the username and password, it gives this message:
mysqli_real_connect(): (HY000/2002): No such file or directory
If i write "mysql" on terminal, it shows me this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've looked up the solution for this, but what I encountered was to check the "var/log/mysql/error.log". I did that, and that file is empty.
I have no idea what I have to do here and it seems none of the solutions I found on the internet helped me on this one.
I tried re-installing MySQL but it didn't change anything
If i try to "sudo service mysql start", it shows me this:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
systemctl status mysql.service:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-12-21 15:01:42 -03; 3min 54s ago
Process: 24948 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: Stopped MySQL Community Server.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Start request repeated too quickly.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Failed with result 'exit-code'.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: Failed to start MySQL Community Server.
journalctl -xe:
--
-- A unidade mysql.service concluiu o desligamento.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Start request repeated too quickly.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: Failed to start MySQL Community Server.
-- Subject: A unidade mysql.service falhou
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A unidade mysql.service falhou.
--
-- O resultado é failed.
dez 21 15:01:43 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
dez 21 15:01:49 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=1>
dez 21 15:03:54 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=1>
dez 21 15:05:04 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=1>
dez 21 15:05:34 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
dez 21 15:05:41 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
lines 2441-2464/2464 (END)
-- Support: http://www.ubuntu.com/support
--
-- A unidade mysql.service concluiu o desligamento.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Start request repeated too quickly.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
dez 21 15:01:42 eduardo-System-Product-Name systemd[1]: Failed to start MySQL Community Server.
-- Subject: A unidade mysql.service falhou
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A unidade mysql.service falhou.
--
-- O resultado é failed.
dez 21 15:01:43 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
dez 21 15:01:49 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=20290 PROTO=2
dez 21 15:03:54 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=20298 PROTO=2
dez 21 15:05:04 eduardo-System-Product-Name kernel: [UFW BLOCK] IN=enp3s0 OUT= MAC=01:00:5e:00:00:01:18:9c:27:4f:4e:71:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=20304 PROTO=2
dez 21 15:05:34 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
dez 21 15:05:41 eduardo-System-Product-Name gnome-terminal-[23942]: g_menu_insert_item: assertion 'G_IS_MENU_ITEM (item)' failed
Related
I installed MySql 5.7 for work, now I got an active MySql server running on standart port 3306, that I can't terminate.
I tried service mysql stop and service mysqld stop. No active processes as well.
This is the output of service mysql status :
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-11-16 10:09:46 CET; 9min ago
Process: 65951 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 65990 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Nov 16 10:09:44 user systemd[1]: Starting MySQL Community Server...
Nov 16 10:09:44 user mysqld[65990]: Initialization of mysqld failed: 0
Nov 16 10:09:44 user systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 10:09:46 user systemd[1]: mysql.service: Failed with result 'exit-code'.
Nov 16 10:09:46 user systemd[1]: Stopped MySQL Community Server.
localhost:3006 Response :
Response
Output of journalctl -xe :
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mysql.service has finished with a failure.
--
-- The job identifier is 13189 and the job result is failed.
Nov 16 10:36:40 user systemd[1]: mysql.service: Scheduled restart job, restart counter is at 37.
-- 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.
Nov 16 10:36:40 user systemd[1]: Stopped MySQL Community Server.
-- Subject: A stop job for unit mysql.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit mysql.service has finished.
--
-- The job identifier is 13262 and the job result is done.
Nov 16 10:36:40 user systemd[1]: Starting MySQL Community Server...
-- Subject: A start job for unit mysql.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mysql.service has begun execution.
--
-- The job identifier is 13262.
Nov 16 10:36:40 user audit[71661]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/usr/sbin/mysqld>
Nov 16 10:36:40 user kernel: audit: type=1400 audit(1668591400.604:1307): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile=>
Nov 16 10:36:40 user mysqld[71662]: Initialization of mysqld failed: 0
Nov 16 10:36:40 user systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit mysql.service has exited.
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?
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/
I just upgraded my RHEL system from 6.7 to 7.2, and am having issues starting up MySQL again.
When running:
# systemctl start mysqld
I get this error:
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
systemctl status tells me the following:
● mysqld.service - SYSV: MySQL database server.
Loaded: loaded (/etc/rc.d/init.d/mysqld)
Active: failed (Result: exit-code) since Tue 2017-05-02 10:00:52 CDT; 59s ago
Docs: man:systemd-sysv-generator(8)
Process: 21827 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)
May 02 10:00:51 sa-dnca01.zs.local systemd[1]: Starting SYSV: MySQL database server....
May 02 10:00:52 sa-dnca01.zs.local mysqld[21827]: MySQL Daemon failed to start.
May 02 10:00:52 sa-dnca01.zs.local mysqld[21827]: Starting mysqld: [FAILED]
May 02 10:00:52 sa-dnca01.zs.local systemd[1]: mysqld.service: control process exited, code=exited status=1
May 02 10:00:52 sa-dnca01.zs.local systemd[1]: Failed to start SYSV: MySQL database server..
May 02 10:00:52 sa-dnca01.zs.local systemd[1]: Unit mysqld.service entered failed state.
May 02 10:00:52 sa-dnca01.zs.local systemd[1]: mysqld.service failed.
And then journalctl -xe tells me the following:
May 02 10:03:09 sa-dnca01.zs.local polkitd[768]: Registered Authentication Agent for unix-process:22276:29249716 (system bus name :1.30 [/usr/bin/
May 02 10:03:09 sa-dnca01.zs.local systemd[1]: Starting SYSV: MySQL database server....
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has begun starting up.
May 02 10:03:10 sa-dnca01.zs.local mysqld[22281]: MySQL Daemon failed to start.
May 02 10:03:10 sa-dnca01.zs.local mysqld[22281]: Starting mysqld: [FAILED]
May 02 10:03:10 sa-dnca01.zs.local systemd[1]: mysqld.service: control process exited, code=exited status=1
May 02 10:03:10 sa-dnca01.zs.local systemd[1]: Failed to start SYSV: MySQL database server..
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
May 02 10:03:10 sa-dnca01.zs.local systemd[1]: Unit mysqld.service entered failed state.
May 02 10:03:10 sa-dnca01.zs.local systemd[1]: mysqld.service failed.
May 02 10:03:10 sa-dnca01.zs.local polkitd[768]: Unregistered Authentication Agent for unix-process:22276:29249716 (system bus name :1.30, object
I don't really know what any of this means, but I did have a successfully running MySQL server before the server had an OS upgrade.
Turns out I was getting this error because I hadn't created the necessary logging directory in:
/var/run/mysqld
and given it the proper permissions.
Looking at the log file in /var/log/mysqld.log led me to the issue.
After rebooting server, I can't start mysql again
I received this message:
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
I tried journalctl -xe and received this
-- 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.
Nov 06 21:25:57 myserver systemd[1]: mysql.service: Unit entered failed state.
Nov 06 21:25:57 myserver systemd[1]: mysql.service: Failed with result 'exit-code'.
Nov 06 21:25:57 myserver systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Nov 06 21:25:57 myserver 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.
Nov 06 21:25:57 myserver 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.
Nov 06 21:25:58 myserver systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
here is the result for systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Sun 2016-11-06 21:29:00 UTC; 21s ago
Process: 4563 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 4560 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 4563 (code=exited, status=1/FAILURE); : 4566 (mysql-systemd-s)
Tasks: 2
Memory: 320.0K
CPU: 400ms
CGroup: /system.slice/mysql.service
└─control
├─4566 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─4625 sleep 1
Nov 06 21:29:00 myserver systemd[1]: Starting MySQL Community Server...
Nov 06 21:29:01 myserver systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Please help ! Thank you!
I found out the solution after checking mysql error.log
The disk was full.