MySQL不停重启问题

MySQL不停的自动杀掉自动重启

看一下log日志 my.cnf 里配置的 log_error =/var/log/mysqld.log

vim /var/log/mysqld.log

报的错误只是

ERROR Can't start server: Bind on TCP/IP port: Address already in use

ERROR Do you already have another mysqld server running on port: 3306 ?

除了MySQL自己的那个3306 其它没有进程有占用这个端口 MySQL自己一直在不停重启

网上搜了很多 其中看到 加上一行 innodb_force_recovery=4 可以先不让MySQL重启 试了不行 还是不停的重启

sudo /usr/local/mysql/bin/mysqld --console

查看发现 ERROR Can't find messagefile ***

复制代码
2023-08-22 22:06:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-08-22 22:06:24 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2023-08-22 22:06:24 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.47-87.0) starting as process 7763 ...
2023-08-22 22:06:24 7763 [ERROR] Can't find messagefile '/usr/local/Percona-Server-5.6.47-rel87.0-Linux.x86_64.ssl101/share/errmsg.sys'
2023-08-22 22:06:24 7763 [Warning] Can't create test file /usr/local/Percona-Server-5.6.47-rel87.0-Linux.x86_64.ssl101/data/iZ8vbidmq7xeaamvtoal4wZ.lower-test
2023-08-22 22:06:24 7763 [Warning] Can't create test file /usr/local/Percona-Server-5.6.47-rel87.0-Linux.x86_64.ssl101/data/iZ8vbidmq7xeaamvtoal4wZ.lower-test
/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/Percona-Server-5.6.47-rel87.0-Linux.x86_64.ssl101/data/' (Errcode: 2 - No such file or directory)
2023-08-22 22:06:24 7763 [ERROR] Aborting

2023-08-22 22:06:24 7763 [Note] Binlog end
2023-08-22 22:06:24 7763 [Note]

sudo vim /usr/local/mysql/my.cnf

加上一行 lc-messages-dir=/usr/local/mysql/share/

目录指定成mysql安装目录下的share目录

再启动MySQL 发现可以了 不一直自动重启了

访问站点发现表都是只读的 需要去掉my.cnf中配置的innodb_force_recovery=4

然后重启MySQL

然后MySQL正常运行了

正常运行后再 sudo /usr/local/mysql/bin/mysqld --console 看时 依然有ERROR Can't find messagefile ***

后面去掉my.cnf中的lc-messages-dir=/usr/local/mysql/share/ 这一行

再重启一下MySQL 发现MySQL还是正常的

。。 先不纠结了

相关推荐
就叫_这个吧2 小时前
Redis从基础命令到核心机制简单介绍
数据库·redis·缓存
三十岁老牛再出发2 小时前
07.27&7.28每日总结
c语言·mysql
dear_bi_MyOnly2 小时前
【MyBatis 操作数据库】
java·数据库·学习·mybatis·学习方法
DBA_G3 小时前
南大通用GBase 8s数据库新存储引擎核心能力二
数据库·微服务·架构
衣乌安、5 小时前
数据库事务原理与回滚机制
数据库
CodexDave6 小时前
PostgreSQL 明明有索引却选了 Nested Loop:从行数误判修正执行计划
数据库·postgresql·执行计划·扩展统计·nestedloop
czhaii7 小时前
STC ai助手单片机工程项目创建实例
数据库·mongodb
山峰哥8 小时前
数据库性能救星:Explain执行计划深度拆解
服务器·开发语言·数据库·sql·启发式算法
oradh8 小时前
Oracle 11g rac IP地址修改(public ip、vip、scan ip、priviate ip)
数据库·tcp/ip·oracle·rac ip地址修改
YOU OU8 小时前
Redis哨兵 & 集群
数据库·redis·sentinel