MySQL崩溃解决办法

当尝试访问特定表时,MySQL出现崩溃。通过日志分析,发现该表为复制自一个分区表并添加了新字段,这导致了崩溃。解决方法包括删除表,重新复制不带分区的版本,然后安全地添加字段。
部署运行你感兴趣的模型镜像

重现方法

执行 select * from test,MySQL自动奔溃关闭,访问其他的表没有问题,单独这个表绝对会这样。

报错日志

07:30:01 UTC - mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=8192
max_used_connections=2
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 49892 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0xd50b4b0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
13fb3919e    mysqld.exe!??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z()
14037ef99    mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z()
14037f259    mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z()
14037e642    mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z()
13fa377f6    mysqld.exe!?ha_open@handler@@QEAAHPEAUTABLE@@PEBDHH@Z()
13fbe04f6    mysqld.exe!?open_table_from_share@@YAHPEAVTHD@@PEAUTABLE_SHARE@@PEBDIIIPEAUTABLE@@_N@Z()
13fafaaa1    mysqld.exe!?open_table@@YA_NPEAVTHD@@PEAUTABLE_LIST@@PEAVOpen_table_context@@@Z()
13faf9b4d    mysqld.exe!?open_and_lock_tables@@YA_NPEAVTHD@@PEAUTABLE_LIST@@IPEAVPrelocking_strategy@@@Z()
13fafb711    mysqld.exe!?open_tables@@YA_NPEAVTHD@@PEAPEAUTABLE_LIST@@PEAIIPEAVPrelocking_strategy@@@Z()
13fafbabe    mysqld.exe!?open_tables_for_query@@YA_NPEAVTHD@@PEAUTABLE_LIST@@I@Z()
13fa558c8    mysqld.exe!?execute_init_command@@YAXPEAVTHD@@PEAUst_mysql_lex_string@@PEAUst_mysql_rwlock@@@Z()
13fa578d6    mysqld.exe!?mysql_execute_command@@YAHPEAVTHD@@_N@Z()
13fa5b358    mysqld.exe!?mysql_parse@@YAXPEAVTHD@@PEAVParser_state@@@Z()
13fa543f4    mysqld.exe!?dispatch_command@@YA_NPEAVTHD@@PEBTCOM_DATA@@W4enum_server_command@@@Z()
13fa5541a    mysqld.exe!?do_command@@YA_NPEAVTHD@@@Z()
13f9fbcac    mysqld.exe!handle_connection()
140459772    mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z()
14016c2dc    mysqld.exe!my_thread_once()
7fef8764f6b    MSVCR120.dll!_beginthreadex()
7fef8765098    MSVCR120.dll!_endthreadex()
76d159cd    kernel32.dll!BaseThreadInitThunk()
76fb385d    ntdll.dll!RtlUserThreadStart()

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (d5232b0): select * from test
Connection ID (thread ID): 2
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

分析原因

这个新表是复制来自一个含有分区的新表,复制之后,执行正常,但在phpmyadmin上进行了增加操作,加入了10个新字段,点击保存结构后就一直出现自动奔溃退出,重启后只要select就立即如此。

解决方法

先删除这个表,重新复制一份,再ALTER TABLE tbl REMOVE PARTITIONING 移除表分区,重新加字段

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

使用链表(Linked List)是一种常见的数据结构,它由一系列节点组成,每个节点包含数据以及指向下一个节点的指针。在管理学生信息时,我们可以用链表来存储学生的信息,例如: 1. 每个节点(StudentNode)代表一个学生,包含学生ID、姓名和分数(score)三个属性。 ```python class StudentNode: def __init__(self, student_id, name, score): self.student_id = student_id self.name = name self.score = score self.next = None # 指向下一个节点 self.prev = None # 如果是在双向链表中,指向前一个节点 ``` 2. 双向链表(Doubly Linked List)则增加了一个prev指针,使得在删除或查找时更高效。 ```python class DoublyLinkedList: def __init__(self): self.head = None self.tail = None # 尾部节点 # 添加节点 def append(self, student_data): new_node = StudentNode(*student_data) if not self.head: self.head = self.tail = new_node else: self.tail.next = new_node new_node.prev = self.tail self.tail = new_node ``` 3. 基本操作包括添加学生、删除学生、查找学生和更新成绩: - `append`方法用于添加学生到链表尾部。 - `delete`方法通过遍历找到指定ID的学生并移除。 - `find`方法通过遍历查找特定ID的学生。 - `update_score`方法在找到学生后修改其分数。 4. 高级操作如获取成绩区间内的学生列表和合并两个链表可以这样设计: - `get_students_in_score_range`方法需要遍历整个链表并检查分数差异。 - `merge_lists`方法需要比较两个链表的头节点,合并它们,同时处理重复的ID问题。 5. 示例代码: ```python def get_students_in_score_range(self, target_score, range=5): ... # 实现计算成绩范围内学生的逻辑 def merge_lists(self, other_list): ... # 实现合并两个链表的逻辑,避免重复 ```
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值