ubuntu mysql5.7 startup prompt error: /var/run/mysqld/mysqld.sock

created at 07-27-2021 views: 6

ubuntu mysql5.7 startup prompt error

mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Use journalctl -xe

journalctl -xe
12月 10 11:49:38 user-70DGA014CN kernel: ata3.00: configured for UDMA/133
12月 10 11:49:38 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
12月 10 11:49:38 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#16 Sense Key : Medium Error [current] 
12月 10 11:49:38 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#16 Add. Sense: Unrecovered read error
12月 10 11:49:38 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#16 CDB: Read(16) 88 00 00 00 00 00 5c 56 24 c0 00 00 00 08 00 00
12月 10 11:49:38 user-70DGA014CN kernel: print_req_error: I/O error, dev sda, sector 1549149383
12月 10 11:49:38 user-70DGA014CN kernel: ata3: EH complete
12月 10 11:49:38 user-70DGA014CN systemd[1]: mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
12月 10 11:50:05 user-70DGA014CN systemd[1]: Failed to start MySQL Community Server.
-- Subject: mysql.service 单元已失败
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- mysql.service 单元已失败。
-- 
-- 结果为“failed”。
12月 10 11:50:05 user-70DGA014CN systemd[1]: mysql.service: Unit entered failed state.
12月 10 11:50:05 user-70DGA014CN systemd[1]: mysql.service: Failed with result 'exit-code'.
12月 10 11:50:05 user-70DGA014CN systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
12月 10 11:50:05 user-70DGA014CN systemd[1]: Stopped MySQL Community Server.
-- Subject: mysql.service 单元已结束停止操作
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- mysql.service 单元已结束停止操作。
12月 10 11:50:05 user-70DGA014CN systemd[1]: Starting MySQL Community Server...
-- Subject: mysql.service 单元已开始启动
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- mysql.service 单元已开始启动。
12月 10 11:50:05 user-70DGA014CN audit[8266]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/8266/status" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=123
12月 10 11:50:05 user-70DGA014CN kernel: audit: type=1400 audit(1544413805.884:13993): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/8266/status" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=123
12月 10 11:50:05 user-70DGA014CN kernel: audit: type=1400 audit(1544413805.884:13994): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=0
12月 10 11:50:05 user-70DGA014CN kernel: audit: type=1400 audit(1544413805.884:13995): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/8266/status" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=123
12月 10 11:50:05 user-70DGA014CN audit[8266]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=0
12月 10 11:50:05 user-70DGA014CN audit[8266]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/8266/status" pid=8266 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=123 ouid=123
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: exception Emask 0x0 SAct 0x400000 SErr 0x0 action 0x0
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: irq_stat 0x40000008
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: failed command: READ FPDMA QUEUED
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: cmd 60/08:b0:c0:24:56/00:00:5c:00:00/40 tag 22 ncq dma 4096 in
                                                   res 43/40:08:c7:24:56/00:00:5c:00:00/00 Emask 0x408 (media error) <F>
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: status: { DRDY SENSE ERR }
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: error: { UNC }
12月 10 11:50:09 user-70DGA014CN kernel: ata3.00: configured for UDMA/133
12月 10 11:50:09 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#22 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
12月 10 11:50:09 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#22 Sense Key : Medium Error [current] 
12月 10 11:50:09 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#22 Add. Sense: Unrecovered read error
12月 10 11:50:09 user-70DGA014CN kernel: sd 2:0:0:0: [sda] tag#22 CDB: Read(16) 88 00 00 00 00 00 5c 56 24 c0 00 00 00 08 00 00
12月 10 11:50:09 user-70DGA014CN kernel: print_req_error: I/O error, dev sda, sector 1549149383
12月 10 11:50:09 user-70DGA014CN kernel: ata3: EH complete
12月 10 11:50:09 user-70DGA014CN systemd[1]: mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Use systemctl status mysql.service

>>> 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 一 2018-12-10 11:53:08 CST; 8s ago
  Process: 8815 ExecStart=/usr/sbin/mysqld (code=exited, status=2)
  Process: 8807 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 8815 (code=exited, status=2);         : 8816 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           └─control
             ├─8816 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─8852 sleep 1

12月 10 11:53:08 user-70DGA014CN systemd[1]: Starting MySQL Community Server...
12月 10 11:53:12 user-70DGA014CN systemd[1]: mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
created at:07-27-2021
edited at: 07-27-2021: