首页 > 数据库 >ubuntu22.04 mysql服务每天自动shutdown问题

ubuntu22.04 mysql服务每天自动shutdown问题

时间:2024-01-22 10:56:59浏览次数:38  
标签:R620 12 06 33 ubuntu22.04 shutdown mysql PowerEdge gmt

1. 问题描述

MYSQL 每天自动关闭,查看/var/log/mysql/error.log.1.gz ,内容如下:

2019-06-12T06:33:13.582973+08:00 0 [Note] Shutting down plugin ‘CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS’
2019-06-12T06:33:13.583022+08:00 0 [Note] Shutting down plugin ‘CONNECTION_CONTROL’
2019-06-12T06:33:13.583053+08:00 0 [Note] Shutting down plugin ‘ngram’
2019-06-12T06:33:13.583066+08:00 0 [Note] Shutting down plugin ‘partition’
2019-06-12T06:33:13.583078+08:00 0 [Note] Shutting down plugin ‘ARCHIVE’
2019-06-12T06:33:13.583089+08:00 0 [Note] Shutting down plugin ‘BLACKHOLE’
2019-06-12T06:33:13.583101+08:00 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2019-06-12T06:33:13.583111+08:00 0 [Note] Shutting down plugin ‘MEMORY’
2019-06-12T06:33:13.583122+08:00 0 [Note] Shutting down plugin ‘MyISAM’
2019-06-12T06:33:13.583137+08:00 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2019-06-12T06:33:13.583202+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_VIRTUAL’
2019-06-12T06:33:13.583218+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_DATAFILES’
2019-06-12T06:33:13.583228+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES’
2019-06-12T06:33:13.583238+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS’
2019-06-12T06:33:13.583247+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN’
2019-06-12T06:33:13.583256+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
2019-06-12T06:33:13.583265+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_COLUMNS’
2019-06-12T06:33:13.583274+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_INDEXES’
2019-06-12T06:33:13.583283+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS’
2019-06-12T06:33:13.583292+08:00 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLES’
2019-06-12T06:33:13.583302+08:00 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE’

2. 解决过程

网上有很多帖子,基本都是修改 /etc/mysql/my.cnf 文件相关配置

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
log_bin=mysql_bin_log
server-id=1
max_connections=1024
open_files_limit=65535
table_open_cache=2048
#connection-control-failed-connections-threshold=5 #login failed times
#connection-control-min-connection-delay=108000 #login tryagin timeout
skip-name-resolve
wait_timeout=31536000
interactive_timeout=31536000
explicit_defaults_for_timestamp=true
skip-ssl
log_timestamps = SYSTEM

尝试修改了各种参数,/var/log/mysql/error.log 中各种错误信息一个都没有了,但是第二天还是关机,问题没有解决,有点崩溃了。

mysql的错误日志文件没有任何错误信息,只能看系统日志文件了。

vi /var/log/syslog.1

mon.Worker [INFO]: Updating cache
Jun 12 06:26:49 gmt-PowerEdge-R620 AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/1cf051be572f4eab833c3ae618e14ace
Jun 12 06:26:49 gmt-PowerEdge-R620 org.debian.apt[1493]: 06:26:49 AptDaemon.Worker [INFO]: Finished transaction /org/debian/apt/transaction/1cf051be572f4eab833c3ae618e14ace
Jun 12 06:31:52 gmt-PowerEdge-R620 systemd[1]: Starting Daily apt upgrade and clean activities…
Jun 12 06:33:05 gmt-PowerEdge-R620 gnome-session[5949]: (gnome-software:6160): As-WARNING **: failed to rescan: Failed to parse /usr/share/applications/vim.desktop.dpkg-new file: cannot process file of type text/plain
Jun 12 06:33:05 gmt-PowerEdge-R620 gnome-session[5949]: (gnome-software:6160): As-WARNING **: failed to rescan: Failed to parse /usr/share/applications/vim.desktop.dpkg-tmp file: cannot process file of type text/plain
Jun 12 06:33:06 gmt-PowerEdge-R620 gnome-session[5949]: (gnome-software:6160): As-WARNING **: failed to rescan: Failed to parse /usr/share/applications/vim.desktop file: cannot process file of type application/x-desktop
Jun 12 06:33:07 gmt-PowerEdge-R620 systemd[1]: Reloading.
Jun 12 06:33:07 gmt-PowerEdge-R620 systemd[1]: [/lib/systemd/system/mysql.service:22] Unknown lvalue ‘LimitNPPOC’ in section ‘Service’
Jun 12 06:33:07 gmt-PowerEdge-R620 systemd[1]: Started CUPS Scheduler.
Jun 12 06:33:07 gmt-PowerEdge-R620 systemd[1]: Started ACPI event daemon.
Jun 12 06:33:10 gmt-PowerEdge-R620 systemd[1]: Reloading.
Jun 12 06:33:10 gmt-PowerEdge-R620 systemd[1]: [/lib/systemd/system/mysql.service:22] Unknown lvalue ‘LimitNPPOC’ in section ‘Service’
Jun 12 06:33:10 gmt-PowerEdge-R620 systemd[1]: Started CUPS Scheduler.
Jun 12 06:33:10 gmt-PowerEdge-R620 systemd[1]: Started ACPI event daemon.
Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: Reloading.
Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: [/lib/systemd/system/mysql.service:22] Unknown lvalue ‘LimitNPPOC’ in section ‘Service’
Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: Started CUPS Scheduler.
Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: Started ACPI event daemon.
Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: Stopping MySQL Community Server…
Jun 12 06:33:15 gmt-PowerEdge-R620 systemd[1]: Stopped MySQL Community Server.
Jun 12 06:33:19 gmt-PowerEdge-R620 systemd[1]: Reloading.
Jun 12 06:33:19 gmt-PowerEdge-R620 systemd[1]: [/lib/systemd/system/mysql.service:22] Unknown lvalue ‘LimitNPPOC’ in section ‘Service’
Jun 12 06:33:19 gmt-PowerEdge-R620 systemd[1]: Started CUPS Scheduler.
Jun 12 06:33:19 gmt-PowerEdge-R620 systemd[1]: Started ACPI event daemon.
Jun 12 06:33:20 gmt-PowerEdge-R620 dbus[1493]: [system] Reloaded configuration
Jun 12 06:33:20 gmt-PowerEdge-R620 systemd[1]: Stopped target Sockets.
Jun 12 06:33:20 gmt-PowerEdge-R620 systemd[1]: Stopping Sockets.
Jun 12 06:33:20 gmt-PowerEdge-R620 systemd[1]: Reached target Sockets.
Jun 12 06:33:21 gmt-PowerEdge-R620 gnome-session[5949]: (gnome-software:6160): As-WARNING **: failed to rescan: Failed to parse /usr/share/applications/bamf-2.index file: cannot process file of type text/plain
Jun 12 06:33:34 gmt-PowerEdge-R620 systemd[1]: Started Daily apt upgrade and clean activities.
Jun 12 06:35:01 gmt-PowerEdge-R620 CRON[19079]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

搜索发现系统日志文件中在 “Jun 12 06:33:11 gmt-PowerEdge-R620 systemd[1]: Stopping MySQL Community Server…” 之前有“Jun 12 06:31:52 gmt-PowerEdge-R620 systemd[1]: Starting Daily apt upgrade and clean activities…” 信息,所以怀疑在每天执行更新的时候,将这个MySQL 给停止了。

所以,将这个每天进行系统更新的任务取消,操作如下:

apt-get remove unattended-upgrades
systemctl kill --kill-who=all apt-daily.service
systemctl stop apt-daily.timer
systemctl disable apt-daily.timer
systemctl stop apt-daily.service
systemctl disable apt-daily.service
systemctl mask apt-daily.service
systemctl daemon-reload

关闭完成后检查结果:

systemctl status apt-daily.timer

注意结果中的:

Active: inactive (dead)

标签:R620,12,06,33,ubuntu22.04,shutdown,mysql,PowerEdge,gmt
From: https://www.cnblogs.com/perfectCats/p/17979536

相关文章

  • Mysql日志审计自动备份日志(按天)
    echooffecho------------------开始备份日志文件------------------setymd=%Date:~0,4%%Date:~5,2%%Date:~8,2%setbackup-dir=C:\tools\mysql-server-auditsetpwd=%你自己的数据库密码%echo备份目录:%backup-dir%echo--------------------------------------------------if......
  • 【LeetCode 2494. 合并在同一个大厅重叠的活动】[MySQL 用户变量/Pandas]面向过程编程
    目录题目地址MySQL代码等效pandas代码题目地址https://leetcode.cn/problems/merge-overlapping-events-in-the-same-hall/MySQL代码#WriteyourMySQLquerystatementbelowwitht2as(select*#----只需要改动这里的逻辑,其他不要动。注意里面的语句是“顺序......
  • 【LeetCode1747. 应该被禁止的 Leetflex 账户】[MySQL 用户变量/Pandas]面向过程编程;
    目录题目地址MySQL代码等效pandas代码题目地址https://leetcode.cn/problems/leetflex-banned-accounts/description/MySQL代码witht1as(selectaccount_id,ip_address,loginastick,"login"asmytypefromLogInfounionallselectaccount_id,ip......
  • 【LeetCode 2701. 连续递增交易】[MySQL 用户变量/Pandas]面向过程编程得到严格递增连
    目录题目地址MySQL代码等效pandas代码题目地址https://leetcode.cn/problems/consecutive-transactions-with-increasing-amounts/MySQL代码#WriteyourMySQLquerystatementbelowwitht1as(select*#--------------------------只需要改动这里的逻辑,其他......
  • 【Leetcode1949. 坚定的友谊】使用MySQL在无向图中寻找{"CompleteTripartite", {1, 1,
    目录题目地址思路代码MySQL代码逐行翻译为Pandas代码等效Cypher查询(未验证)题目地址https://leetcode.cn/problems/strong-friendship/思路就是在无向图中寻找这个pattern:(*Mathematica*)GraphData[{"CompleteTripartite",{1,1,3}}]SQL写还是比较麻烦。更加复杂的查询还是......
  • 【Leetcode 2474. 购买量严格增加的客户】[MySQL 用户变量/Pandas]面向过程编程解决严
    目录题目地址MySQL代码等效pandas代码题目地址https://leetcode.cn/problems/customers-with-strictly-increasing-purchases/description/MySQL代码#WriteyourMySQLquerystatementbelowwitht1as(selectcustomer_id,year(order_date)asmy_year,sum(price)......
  • [转帖]MySQL多版本并发控制机制(MVCC)-源码浅析
    https://zhuanlan.zhihu.com/p/144682180 MySQL多版本并发控制机制(MVCC)-源码浅析前言作为一个数据库爱好者,自己动手写过简单的SQL解析器以及存储引擎,但感觉还是不够过瘾。<<事务处理-概念与技术>>诚然讲的非常透彻,但只能提纲挈领,不能让你玩转某个真正的数据库。感谢c......
  • MySQL - 日志
    1.回滚日志(undolog)作用:保存了事务发生之前的数据的一个版本,可以用于回滚,同时可以提供多版本并发控制下的读(MVCC),也即非锁定读内容:逻辑格式的日志(当delete一条记录是,记录一条对应的insert记录,反之亦然),在执行undo的时候,仅仅是将数据从逻辑上恢复至事务之前的状态释放:当事务提交......
  • django使用redis集群、连接池、MySQL连接池
    redis的相关设置CACHES={"default":{"BACKEND":"django_redis.cache.RedisCache","LOCATION":["redis://127.0.0.1:6379/1","redis://127.0.0.1:6380/1",#...],"OPTIONS":{"CLIENT_......
  • mysql 修改密码
    1、找到根目录登录msql   1)以本机为例,mysql安装目录为:usr/localhost/mysql5.7   2)cd  usr/loclahost/mysql5.7/bin    3)登录    4)查看MySQL用户2、 在mysql5.7版本中存放密码字段为authentication_string,再msyql库中#进入mysql库中mysql>......