解决报错ExecStart=usrsbinmysqld--daemonize--pid-f。。。
问题的由来
MySQL服务没有正常关机,是电脑没电后⾃动关机产⽣,记录⼀下排查过程
1.本以为是pid的问题,上⽹了教程,解决不了,然后看⽇志
看了⽹上各种说是数据库内存溢出
2021-03-12T10:41:18.317167Z 0 [Note] Binlog end
2021-03-12T10:41:18.317217Z 0 [Note] Shutting down plugin 'CSV'
2021-03-12T10:41:18.317389Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2021-03-12T10:41:18.671273Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details) 2021-03-12T10:41:18.672016Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.33-0ubuntu0.18.04.1) starting as process 2125 ...
2021-03-12T10:41:18.675569Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-03-12T10:41:18.675608Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-03-12T10:41:18.675611Z 0 [Note] InnoDB: Uses event mutexes
2021-03-12T10:41:18.675614Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-03-12T10:41:18.675617Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-12T10:41:18.675619Z 0 [Note] InnoDB: Using Linux native AIO
2021-03-12T10:41:18.675770Z 0 [Note] InnoDB: Number of pools: 1
2021-03-12T10:41:18.675820Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-03-12T10:41:18.677170Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-03-12T10:41:18.684020Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-12T10:41:18.685248Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-12T10:41:18.699329Z 0 [ERROR] InnoDB: Only one log file found.
2021-03-12T10:41:18.699360Z 0 [ERROR] InnoDB: Plugin initialization aborted with error not found
2021-03-12T10:41:19.310191Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-03-12T10:41:19.310270Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-03-12T10:41:19.310284Z 0 [ERROR] Failed to initialize builtin plugins.
2021-03-12T10:41:19.310290Z 0 [ERROR] Aborting
exited2021-03-12T10:41:19.310340Z 0 [Note] Binlog end
2021-03-12T10:41:19.310422Z 0 [Note] Shutting down plugin 'CSV'
2021-03-12T10:41:19.310978Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2.排查⽇志后发现,因为/var/lib/ib_logfile中记录者innoDB⼀些引擎的信息,在server未正常关闭的情况下,重启后的server不⽀持innodb的引擎,删除记录innodb的配置⽂件,
rm -rf ./ib_logfile*
重启mysql,启动正常
systemctl start mysqld
Failed to start mysqld.service: Unit mysqld.service not found.
root@mysql-master:/var/lib/mysql# systemctl start mysqld
Failed to start mysqld.service: Unit mysqld.service not found.
root@mysql-master:/var/lib/mysql# systemctl start mysql
root@mysql-master:/var/lib/mysql# systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-03-1218:44:30 CST; 5s ago
Process: 2199 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited,
Process: 2175 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 2201 (mysqld)
Tasks: 27 (limit: 2290)
CGroup: /system.slice/mysql.service
└─2201 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Mar 1218:44:28 mysql-master systemd[1]: Starting MySQL
Mar 1218:44:30 mysql-master systemd[1]: Started MySQL Community Server.
查看MySQL的端⼝3306
ss -tnl
State      Recv-Q      Send-Q              Local Address:Port                Peer Address:Port
LISTEN      01280.0.0.0:1110.0.0.0:*
LISTEN      0128127.0.0.53%lo:530.0.0.0:*
LISTEN      01280.0.0.0:220.0.0.0:*
LISTEN      0128127.0.0.1:60100.0.0.0:*
LISTEN      01280.0.0.0:372110.0.0.0:*
LISTEN      0640.0.0.0:20490.0.0.0:*
LISTEN      01280.0.0.0:474590.0.0.0:*
LISTEN      0640.0.0.0:434610.0.0.0:*
LISTEN      01280.0.0.0:504750.0.0.0:*
LISTEN      064                          [::]:37039                      [::]:*
LISTEN      0128                          [::]:111                        [::]:*
LISTEN      0128                          [::]:22                          [::]:*
LISTEN      0128                          [::]:38455                      [::]:*          LISTEN      0128                        [::1]:6010                        [::]:*          LISTEN      064                          [::]:2049                        [::]:*          LISTEN      0128                          [::]:52773                      [::]:*          LISTEN      0128                          [::]:37129                      [::]:*          LISTEN      080                              *:3306                          *:*
mysql的端⼝ok,正常访问数据库没有问题

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。