当前位置:论坛首页 > Linux面板 > 求助

【已完成】MYSQL每次服务器重启,都需手动启动MYSQL

发表在 Linux面板2023-4-15 10:53 [复制链接] 6 2316

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:

[url=]7.9.9[/url]
系统版本:

CentOS Stream 9 x86_64(Py3.7.8) 
问题描述:

MYSQL每次服务器重启,都需手动启动MYSQL,卸载重新安装5.7和8.0版本的都是如此,服务器重启不能自动启动MYSQL
相关截图(日志、错误):

1.jpg 日志:
[root@VM-0-7-centos ~]# cat /www/server/data/*.err | grep -i -C 10 ERROR
2023-04-14T09:21:37.361642Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:21:37.361725Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:21:37.361803Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:21:37.361822Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1080324
2023-04-14T09:21:37.377596Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:21:37.379149Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:21:37.590169Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:21:37.883988Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-14T09:21:37.884021Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-14T09:21:37.908996Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2023-04-14T09:21:37.909111Z 0 [System] [MY-010931] [Server] /www/server/mysql/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution.
2023-04-14T09:21:43.955127Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.32).
2023-04-14T09:21:45.277818Z 0 [System] [MY-010910] [Server] /www/server/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.32)  Source distribution.
2023-04-14T09:21:46.676133Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:21:46.676215Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:21:46.676289Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:21:46.676306Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1081913
2023-04-14T09:21:46.690505Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:21:46.692072Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:21:46.901075Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:21:47.115403Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-14T09:21:47.115436Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-14T09:21:47.138484Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /tmp/mysqlx.sock
2023-04-14T09:21:47.138609Z 0 [System] [MY-010931] [Server] /www/server/mysql/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/tmp/mysql.sock'  port: 0  Source distribution.
2023-04-14T09:21:54.796932Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:21:54.797016Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:21:54.797093Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:21:54.797110Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1082673
2023-04-14T09:21:54.811612Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:21:54.813191Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:21:55.126576Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:21:56.896550Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:21:56.896635Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:21:56.896713Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:21:56.896730Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1083340
2023-04-14T09:21:56.911207Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:21:56.912785Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:21:57.229850Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:21:57.384687Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2023-04-14T09:21:57.397133Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2023-04-14T09:21:57.435924Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-14T09:21:57.435961Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-14T09:21:57.459338Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2023-04-14T09:21:57.459423Z 0 [System] [MY-010931] [Server] /www/server/mysql/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution.
2023-04-14T09:24:10.178241Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.32).
2023-04-14T09:24:10.588845Z 0 [System] [MY-010910] [Server] /www/server/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.32)  Source distribution.
2023-04-14T09:24:12.093853Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:24:12.093972Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:24:12.094076Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:24:12.094101Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1096634
2023-04-14T09:24:12.107723Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:24:12.109793Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:24:12.364686Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:24:12.791102Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-14T09:24:12.791170Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-14T09:24:12.831393Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /tmp/mysqlx.sock
2023-04-14T09:24:12.831515Z 0 [System] [MY-010931] [Server] /www/server/mysql/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/tmp/mysql.sock'  port: 0  Source distribution.
2023-04-14T09:24:20.201756Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-14T09:24:20.201894Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-14T09:24:20.202010Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-14T09:24:20.202036Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 1098472
2023-04-14T09:24:20.215725Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-14T09:24:20.218040Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-14T09:24:20.647978Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-14T09:24:20.892139Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2023-04-14T09:24:20.900890Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2023-04-14T09:24:20.981610Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-14T09:24:20.981681Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-14T09:24:21.020836Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock



MYSQL配置
[client]
#password        = your_password
port                = 3306
socket                = /tmp/mysql.sock

[mysqld]
port                = 3306
socket                = /tmp/mysql.sock
datadir = /www/server/data
default_storage_engine = InnoDB
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
key_buffer_size = 64M
max_allowed_packet = 100G
table_open_cache = 256
sort_buffer_size = 1M
net_buffer_length = 4K
read_buffer_size = 1M
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 16M
thread_cache_size = 32
tmp_table_size = 64M
default_authentication_plugin = mysql_native_password
lower_case_table_names = 1
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

explicit_defaults_for_timestamp = true
#skip-name-resolve
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535

log-bin=mysql-bin
binlog_format=mixed
server-id = 1
binlog_expire_logs_seconds = 600000
slow_query_log=1
slow-query-log-file=/www/server/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
early-plugin-load = ""


innodb_data_home_dir = /www/server/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /www/server/data
innodb_buffer_pool_size = 256M
innodb_log_file_size = 128M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 2
innodb_write_io_threads = 2

[mysqldump]
quick
max_allowed_packet = 500M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 64M
sort_buffer_size = 1M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


使用道具 举报 只看该作者 回复
发表于 2023-4-15 10:54:19 | 显示全部楼层
2023-04-15T02:52:16.605025Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2023-04-15T02:52:16.611333Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-04-15T02:52:16.614181Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-04-15T02:52:16.614205Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.32) starting as process 17443
2023-04-15T02:52:16.671593Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2023-04-15T02:52:16.692354Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-15T02:52:17.187384Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-15T02:52:17.558974Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-04-15T02:52:17.559017Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-04-15T02:52:17.599867Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2023-04-15T02:52:17.599918Z 0 [System] [MY-010931] [Server] /www/server/mysql/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution.
使用道具 举报 回复 支持 反对
发表于 2023-4-15 11:36:38 | 显示全部楼层
您好,由于面板的重启重载按钮都还是init.d方式,如果改成systemctl方式自启的话,一边是通过systemctl自启,另外一边又用init方式重启;两者是不同的方式会导致进程容易出错
目前没有其他方法可实现这类自启动问题,可能后续我们会在重新做出一个调整,现阶段暂时没有办法解决
使用道具 举报 回复 支持 反对
发表于 2023-4-15 11:44:05 | 显示全部楼层
感谢解答,那重新配置环境
使用道具 举报 回复 支持 反对
发表于 2023-4-15 11:51:15 | 显示全部楼层
燕知草 发表于 2023-4-15 11:44
感谢解答,那重新配置环境

您可以在计划任务添加mysql自启脚本 检测系统时间超过5分钟后 Mysql没有启动的情况下自动启动
  1. UPTIME=$(uptime |grep min|awk '{print $3}')
  2. if [ "${UPTIME}" -ge "5" ];then
  3.     MYSQL_PID=$(ps -ef|grep -v grep|grep mysql.sock|awk '{print $2}')
  4.     if [ -z "${MYSQL_PID}" ];then
  5.         /etc/init.d/mysqld start
  6.     fi
  7. fi
复制代码
使用道具 举报 回复 支持 反对
发表于 2023-4-15 15:33:40 | 显示全部楼层
谢花郎 发表于 2023-4-15 11:51
您可以在计划任务添加mysql自启脚本 检测系统时间超过5分钟后 Mysql没有启动的情况下自动启动
...

重新配置CentOS 8 环境,重新安装MYSQL8已解决,感谢!!
使用道具 举报 回复 支持 反对
发表于 2023-4-15 15:44:30 | 显示全部楼层
燕知草 发表于 2023-4-15 15:33
重新配置CentOS 8 环境,重新安装MYSQL8已解决,感谢!!

好的,感谢使用宝塔面板,祝您生活愉快!
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表