mysql shutdown and kill
--mysqladmin shutdown
If you execute mysqladmin shutdown when connecting to a local server using a Unix socket file, mysqladminwaits until the server's process ID file has been removed, to ensure that the server has stopped properly.
KILL Syntax
KILL [CONNECTION | QUERY] thread_id
Each connection to mysqld runs in a separate thread. You can see which threads are running with the SHOW PROCESSLIST statement and kill a thread with the KILL statement.thread_id
KILL permits an optional CONNECTION or QUERY modifier:
KILL CONNECTIONis the same asKILLwith no modifier: It terminates the connection associated with the giventhread_id.KILL QUERYterminates the statement that the connection is currently executing, but leaves the connection itself intact.
If you have the PROCESS privilege, you can see all threads. If you have the SUPER privilege, you can kill all threads and statements. Otherwise, you can see and kill only your own threads and statements.
You can also use the mysqladmin processlist and mysqladmin kill commands to examine and kill threads.
You cannot use KILL with the Embedded MySQL Server library because the embedded server merely runs inside the threads of the host application. It does not create any connection threads of its own.
When you use KILL, a thread-specific kill flag is set for the thread. In most cases, it might take some time for the thread to die because the kill flag is checked only at specific intervals:
In
SELECT,ORDER BYandGROUP BYloops, the flag is checked after reading a block of rows. If the kill flag is set, the statement is aborted.During
ALTER TABLE, the kill flag is checked before each block of rows are read from the original table. If the kill flag was set, the statement is aborted and the temporary table is deleted.During
UPDATEorDELETEoperations, the kill flag is checked after each block read and after each updated or deleted row. If the kill flag is set, the statement is aborted. Note that if you are not using transactions, the changes are not rolled back.GET_LOCK()aborts and returnsNULL.An
INSERT DELAYEDthread quickly flushes (inserts) all rows it has in memory and then terminates.If the thread is in the table lock handler (state:
Locked), the table lock is quickly aborted.If the thread is waiting for free disk space in a write call, the write is aborted with a “disk full” error message.
- Warning
Killing a
REPAIR TABLEorOPTIMIZE TABLEoperation on aMyISAMtable results in a table that is corrupted and unusable. Any reads or writes to such a table fail until you optimize or repair it again (without interruption).
mysql shutdown and kill的更多相关文章
- mysql root用户kill connection报ERROR 1095 (HY000): You are not owner of thread N
今日某系统mysql root用户kill connection时报ERROR 1095 (HY000): You are not owner of thread N 按说通过root用户具有supe ...
- xampp启动MySQL出现Error: MySQL shutdown unexpectedly.
20175227张雪莹 2018-2019-2 <Java程序设计> xampp启动MySQL出现Error: MySQL shutdown unexpectedly. 问题 本周在学习教 ...
- 黄聪:xampp运行MySQL shutdown unexpectedly解决方案
相信不少喜欢WordPress的朋友和我一样,会用xampp在本地搭建一个网站学习调试,但是在用的过程中也会遇到些麻烦,毕竟我们都是小白,今天就分享一个xampp运行MySQL数据时出现 Error: ...
- MySQL 循环执行kill语句杀掉连接
mysql中创建索引时,一直卡住不动,刚开始以为可能是数据量太大导致的,可是一直等了很久还是一样没有反应,看来操作的表被锁住了,执行show processlist 果然发现有大量的lock,使用ki ...
- mysql 杀掉(kill) lock进程脚本
杀掉lock进程最快的方法是重启mysql,像你这种情况,1000多sql锁住了,最好是重启如果不允许重启,我提供一个shell脚本,生成 kill id命令杀掉lock线程,如下:--------- ...
- MySQL连接线程kill利器之pt-kill
如何每10秒检查一次,杀死指定用户超过100秒的查询? pt-kill \ --no-version-check \ --host 127.0.0.1 --port 3306 --user 'xxxx ...
- 显示mysql线程和kill线程的命令
show processlist;//显示哪些线程正在运行. kill id //kill线程 通常在表被锁的时候用. show processlist;显示哪些线程正在运行.您也可以使用my ...
- xampp运行MySQL shutdown unexpectedly解决方案
昨天晚上自己的网站突然打不开了,以为被人黑了.想想不应该啊,这小站不会有人关注的,于是登录服务器看了下,发现是Mysql打不开了 很奇怪,因为今天白天还是可以打开的,下班后也没有碰过服务器 首先看看是 ...
- MySQL Session--批量KILL会话
使用SELECT INTO OUTFILE+SOURCE批量KILL ## 查看kill_id文件是否存在 SYSTEM cat /tmp/kill_id.sql ## 如果文件存在,则先删除 sys ...
随机推荐
- 揭开Socket编程的面纱(留着自己慢慢看)
对TCP/IP.UDP.Socket编程这些词你不会很陌生吧?随着网络技术的发展,这些词充斥着我们的耳朵.那么我想问: 1. 什么是TCP/IP.UDP?2. Socket在哪里呢?3. Socket ...
- DotNetCore跨平台~服务总线_事件总线的重新设计
理论闲话 之前在.netFramework平台用的好好的,可升级到.net core平台之后,由于不再需要二进制序列化,导致咱们的事件机制遇到了问题,之前大叔的事件一直是将处理程序序列化后进行存储的, ...
- SPFA 算法详解
适用范围:给定的图存在负权边,这时类似Dijkstra等算法便没有了用武之地,而Bellman-Ford算法的复杂度又过高,SPFA算法便 派上用场了. 我们约定有向加权图G不存在负权回路,即最短路径 ...
- Android反编译odex然后重新打包
#Android反编译odex然后重新打包 最近不知道怎么回事,突然把我那刷了氧OS的root了,然后就开始好奇起来氢OS所带有的那些本地化的东西,比如通话录音就是典型的一个之一.其中也做了很多的尝试 ...
- Java条形码/二维码生成和解析
注意-本类依赖jar包文件:core.jar和zxing-javase.jar 下载jar文件,到本博客文件栏目下载. import com.google.zxing.BarcodeFormat; i ...
- java设计模式 01 开山篇
一. 设计模式概述 设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结.使用设计模式是为了可重用代码.让代码更容易被他人理解.保证代码可靠性. ...
- 实时音视频互动系列(下):基于 WebRTC 技术的实战解析
在 WebRTC 项目中,又拍云团队做到了覆盖系统全局,保证项目进程流畅.这牵涉到主要三大块技术点: 网络端.服务端的开发和传输算法 WebRTC 协议中牵扯到服务端的应用协议和信令服务 客户端iOS ...
- Android-Bluetooth Low Energy(BLE)
Android Bluetooth Low Energy Android 低功耗蓝牙简介 2016-4-18 Android4.3(API 18)介绍了平台支持的低功耗蓝牙,app可用于发现设备,检索 ...
- 浮点数的陷阱--double i != 10 基本都是对的,不管怎么赋值
#include <stdio.h>int main(){ double i; for(i = 10; i != 10, i < 12; i += 0.1) ...
- bzoj2002: [Hnoi2010]Bounce 弹飞绵羊 [分块][LCT]
Description 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏.游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置 ...