InnoDB 死锁

文章目录

  • 死锁案例
    • 等待超时时间
    • InnoDB 状态信息
    • 死锁日志
  • 死锁检测
  • 死锁日志分析


死锁是指多个事务无法继续进行的情况,因为每个事务都持有另一个事务所需的锁。因为所有涉及的事务都在等待同一资源可用,所以它们都不会释放它所持有的锁。

当事务锁定多个表中的行时(通过UPDATE或SELECT ... FOR UPDATE等语句),可能会发生死锁,但顺序相反。当此类语句锁定索引记录和间隙的范围时,也可能发生死锁,由于时间问题,每个事务都会获得一些锁,但不会获得其他锁。关于死锁示例,请参阅第17.7.5.1节“InnoDB死锁示例

为了减少死锁的可能性,可以使用以下策略:

  1. 使用事务而不是LOCK TABLES语句;
  2. 保持插入或更新数据的事务足够小,不会长时间保持打开状态;
  3. 当不同的事务更新多个表或大范围的行时,在每个事务中使用相同的操作顺序(如SELECT … FOR update);
  4. SELECT ... FOR UPDATEUPDATE ... WHERE语句中使用的列上创建索引

死锁的可能性不受隔离级别的影响,因为隔离级别只会改变读取操作的行为,而死锁是由于写入操作而发生的。

死锁案例

https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlock-example.html

假设有A和B两个客户端

# 开启打印死锁信息
SET GLOBAL innodb_print_all_deadlocks = ON;DROP TABLE IF EXISTS Animals;
CREATE TABLE Animals (name VARCHAR(10) PRIMARY KEY, value INT) ENGINE = InnoDB;
DROP TABLE IF EXISTS Birds;
CREATE TABLE Birds (name VARCHAR(10) PRIMARY KEY, value INT) ENGINE = InnoDB;INSERT INTO Animals (name, value) VALUES ("Aardvark", 10);
INSERT INTO Birds (name, value) VALUES ("Buzzard", 20);

A和B均执行SET autocommit=0;关闭自动提交

  1. 客户端A开始事务,并在共享模式的Animals中选择一行:
START TRANSACTION;
SELECT value FROM Animals WHERE name='Aardvark' FOR SHARE;
  1. 然后B开始事务
START TRANSACTION;
SELECT value FROM Birds WHERE name='Buzzard' FOR SHARE;

通过performance_schema.data_locks可以看到加锁情况:

mysql> SELECT ENGINE_TRANSACTION_ID as Trx_Id,->     OBJECT_NAME as `Table`,->     INDEX_NAME as `Index`,->     LOCK_DATA as Data,->     LOCK_MODE as Mode,->     LOCK_STATUS as Status,->     LOCK_TYPE as Type-> FROM performance_schema.data_locks;
+-----------------+---------+---------+------------+---------------+---------+--------+
| Trx_Id          | Table   | Index   | Data       | Mode          | Status  | Type   |
+-----------------+---------+---------+------------+---------------+---------+--------+
| 422009360179200 | Animals | NULL    | NULL       | IS            | GRANTED | TABLE  |
| 422009360179200 | Animals | PRIMARY | 'Aardvark' | S,REC_NOT_GAP | GRANTED | RECORD |
| 422009360180008 | Birds   | NULL    | NULL       | IS            | GRANTED | TABLE  |
| 422009360180008 | Birds   | PRIMARY | 'Buzzard'  | S,REC_NOT_GAP | GRANTED | RECORD |
+-----------------+---------+---------+------------+---------------+---------+--------+
4 rows in set (0.00 sec)
  1. 客户端B随后更新Animals中的一行:
mysql> UPDATE Animals SET value=30 WHERE name='Aardvark';

B必须等待,通过performance_schema.data_lock_waits表可以查到正在等待的事务,结果如下

mysql> SELECT REQUESTING_ENGINE_LOCK_ID as Req_Lock_Id,->      REQUESTING_ENGINE_TRANSACTION_ID as Req_Trx_Id,->     BLOCKING_ENGINE_LOCK_ID as Blk_Lock_Id,->     BLOCKING_ENGINE_TRANSACTION_ID as Blk_Trx_Id-> FROM performance_schema.data_lock_waits;
+----------------------------------------+------------+----------------------------------------+-----------------+
| Req_Lock_Id                            | Req_Trx_Id | Blk_Lock_Id                            | Blk_Trx_Id      |
+----------------------------------------+------------+----------------------------------------+-----------------+
| 140534383469352:92:4:2:140534282801400 |    4243765 | 140534383468544:92:4:2:140534282795040 | 422009360179200 |
+----------------------------------------+------------+----------------------------------------+-----------------+
1 row in set (0.00 sec)mysql> SELECT ENGINE_TRANSACTION_ID as Trx_Id,
CT_NAME as `Tabl    ->     OBJECT_NAME as `Table`,->     INDEX_NAME as `Index`,->     LOCK_DATA as Data,->     LOCK_MODE as Mode,->     LOCK_STATUS as Status,->     LOCK_TYPE as Type-> FROM performance_schema.data_locks;
+-----------------+---------+---------+------------+---------------+---------+--------+
| Trx_Id          | Table   | Index   | Data       | Mode          | Status  | Type   |
+-----------------+---------+---------+------------+---------------+---------+--------+
|         4243765 | Animals | NULL    | NULL       | IX            | GRANTED | TABLE  |
|         4243765 | Birds   | NULL    | NULL       | IS            | GRANTED | TABLE  |
|         4243765 | Birds   | PRIMARY | 'Buzzard'  | S,REC_NOT_GAP | GRANTED | RECORD |
|         4243765 | Animals | PRIMARY | 'Aardvark' | X,REC_NOT_GAP | WAITING | RECORD |
| 422009360179200 | Animals | NULL    | NULL       | IS            | GRANTED | TABLE  |
| 422009360179200 | Animals | PRIMARY | 'Aardvark' | S,REC_NOT_GAP | GRANTED | RECORD |
+-----------------+---------+---------+------------+---------------+---------+--------+
6 rows in set (0.00 sec)mysql> SELECT REQUESTING_ENGINE_LOCK_ID as Req_Lock_Id,->      REQUESTING_ENGINE_TRANSACTION_ID as Req_Trx_Id,->     BLOCKING_ENGINE_LOCK_ID as Blk_Lock_Id,->     BLOCKING_ENGINE_TRANSACTION_ID as Blk_Trx_Id-> FROM performance_schema.data_lock_waits;
Empty set (0.01 sec)

InnoDB仅在事务试图修改数据库时使用顺序事务ID。因此,之前的只读事务id从422009360180008更改为4243765。

  1. 如果客户端A试图同时更新Birds中的一行,这将导致死锁:
mysql> UPDATE Birds SET value=40 WHERE name='Buzzard';
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction

InnoDB回滚导致死锁的事务。现在客户端B可以继续进行第一次更新

mysql> UPDATE Animals SET value=30 WHERE name='Aardvark';
Query OK, 1 row affected (1 min 26.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

整个过程如下图所示
在这里插入图片描述

mysql> SELECT `count` FROM INFORMATION_SCHEMA.INNODB_METRICSWHERE NAME="lock_deadlocks";
+-------+
| count |
+-------+
|     1 |
+-------+
1 row in set (0.00 sec)

等待超时时间

innodb_lock_wait_timeout指的是事务等待获取资源等待的最长时间,超过这个时间还未分配到资源则会返回应用失败;

参数的时间单位是秒,最小可设置为1s(一般不会设置得这么小),最大可设置1073741824秒。默认安装时这个值是50s

参数支持范围为Session和Global,且支持动态修改,所以可以通过两种方法修改;

通过语句修改

set innodb_lock_wait_timeout=100;
set global innodb_lock_wait_timeout=100;

注意global的修改对当前线程是不生效的,只有建立新的连接才生效

修改配置文件/etc/my.cnf

innodb_lock_wait_timeout = 50

当锁等待时间超过设置时间的时候,就会报如下的错误;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

InnoDB 状态信息

InnoDB状态包含以下有关死锁和事务的信息。在LATEST DETECTED DEADLOCK一栏,可以看到,只读事务id由422009360180008更改为顺序事务id值4243765。

mysql> SHOW ENGINE INNODB STATUS\G;
*************************** 1. row ***************************Type: InnoDBName:
Status:
=====================================
2024-09-29 11:19:20 140533613905664 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 4 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 3 srv_active, 0 srv_shutdown, 3228 srv_idle
srv_master_thread log flush and writes: 0
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 2
OS WAIT ARRAY INFO: signal count 5
RW-shared spins 0, rounds 0, OS waits 0
RW-excl spins 0, rounds 0, OS waits 0
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait: 0.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx
------------------------
LATEST DETECTED DEADLOCK
------------------------
2024-09-29 10:30:35 140533919143680
*** (1) TRANSACTION:
TRANSACTION 4243765, ACTIVE 155 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 2 row lock(s)
MySQL thread id 15, OS thread handle 140533616297728, query id 118 localhost root updating
UPDATE Animals SET value=30 WHERE name='Aardvark'*** (1) HOLDS THE LOCK(S):
RECORD LOCKS space id 93 page no 4 n bits 72 index PRIMARY of table `mysql_learn`.`Birds` trx id 4243765 lock mode S locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 00: len 7; hex 42757a7a617264; asc Buzzard;;1: len 6; hex 00000040c12c; asc    @ ,;;2: len 7; hex 81000001160110; asc        ;;3: len 4; hex 80000014; asc     ;;*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 92 page no 4 n bits 72 index PRIMARY of table `mysql_learn`.`Animals` trx id 4243765 lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 00: len 8; hex 416172647661726b; asc Aardvark;;1: len 6; hex 00000040c12a; asc    @ *;;2: len 7; hex 81000001150110; asc        ;;3: len 4; hex 8000000a; asc     ;;*** (2) TRANSACTION:
TRANSACTION 4243766, ACTIVE 164 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 2 row lock(s)
MySQL thread id 14, OS thread handle 140533880583936, query id 137 localhost root updating
UPDATE Birds SET value=40 WHERE name='Buzzard'*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 92 page no 4 n bits 72 index PRIMARY of table `mysql_learn`.`Animals` trx id 4243766 lock mode S locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 00: len 8; hex 416172647661726b; asc Aardvark;;1: len 6; hex 00000040c12a; asc    @ *;;2: len 7; hex 81000001150110; asc        ;;3: len 4; hex 8000000a; asc     ;;*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 93 page no 4 n bits 72 index PRIMARY of table `mysql_learn`.`Birds` trx id 4243766 lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 00: len 7; hex 42757a7a617264; asc Buzzard;;1: len 6; hex 00000040c12c; asc    @ ,;;2: len 7; hex 81000001160110; asc        ;;3: len 4; hex 80000014; asc     ;;*** WE ROLL BACK TRANSACTION (2)
------------
TRANSACTIONS
------------
Trx id counter 4243767
Purge done for trx's n:o < 4243753 undo n:o < 0 state: running but idle
History list length 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 422009360183240, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360182432, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360181624, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360180816, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360179200, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360178392, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360177584, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 422009360176776, not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION 4243765, ACTIVE 3080 sec
4 lock struct(s), heap size 1128, 2 row lock(s), undo log entries 1
MySQL thread id 15, OS thread handle 140533616297728, query id 118 localhost root
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,ibuf aio reads:, log i/o's:, sync i/o's:
Pending flushes (fsync) log: 0; buffer pool: 0
1061 OS file reads, 450 OS file writes, 194 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 60, seg size 62, 0 merges
merged operations:insert 0, delete mark 0, delete 0
discarded operations:insert 0, delete mark 0, delete 0
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 1 buffer(s)
Hash table size 34679, node heap has 4 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number          2325725057
Log buffer assigned up to    2325725057
Log buffer completed up to   2325725057
Log written up to            2325725057
Log flushed up to            2325725057
Added dirty pages up to      2325725057
Pages flushed up to          2325725057
Last checkpoint at           2325725057
88 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 137039872
Dictionary memory allocated 465748
Buffer pool size   8192
Free buffers       7001
Database pages     1186
Old database pages 457
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 1034, created 152, written 287
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 1186, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Process ID=30037, Main thread ID=140533678733056 , state=sleeping
Number of rows inserted 2, updated 1, deleted 0, read 3
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
Number of system rows inserted 28, updated 335, deleted 24, read 6040
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================1 row in set (0.00 sec)

死锁日志

错误日志包含有关事务和锁的信息

mysql> SELECT @@log_error;
+---------------------------+
| @@log_error               |
+---------------------------+
| /var/log/mysql/mysqld.log |
+---------------------------+
1 row in set (0.00 sec)

日志中要由死锁信息的话需要开启innodb_print_all_deadlocks设置:SET GLOBAL innodb_print_all_deadlocks = ON;

死锁检测

参考:https://dev.mysql.com/doc/refman/8.4/en/innodb-deadlock-detection.html
当启用死锁检测(默认设置)并且确实发生死锁时,InnoDB会自动检测到这种情况并回滚其中一个事务(受害者)。如果使用innodb_lock_detect变量禁用死锁检测,innodb将依赖innodb_lock _wait_timeout设置在死锁的情况下回滚事务。

因此,即使您的应用程序逻辑是正确的,您仍然必须处理必须重试事务的情况。

如果频繁的死锁突出了事务结构或应用程序错误处理的问题,请启用innodb_print_all_deadlocks,将有关所有死锁的信息打印到mysqld错误日志中。

InnoDB试图选择要回滚的小事务,其中事务的大小由插入、更新或删除的行数决定。
如果innodb_table_locks=1且autocommit=0,则InnoDB知道表锁,其上的MySQL层知道行级锁。否则,当涉及MySQL lock TABLES语句设置的表锁或InnoDB以外的存储引擎设置的锁时,InnoDB无法检测死锁。通过设置innodb_lock_wait_timeout系统变量的值来解决这些情况。

如果InnoDB Monitor输出的LATEST DETECTED DEADLOCK部分包含一条消息以下面内容开头
TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH, WE WILL ROLL BACK FOLLOWING TRANSACTION

这表示等待队列上的事务数量已达到200个的限制。超过200个事务的等待列表被视为死锁,试图检查等待队列的事务被回滚。如果正在加锁的线程必须查看等待列表上事务所拥有的1000000多个锁,也可能发生相同的错误。

禁用死锁检测

在高并发系统中,当许多线程等待同一个锁时,死锁检测可能会导致速度减慢。有时,当死锁发生时,禁用死锁检测并依赖innodb_lock_wait_timeout设置进行事务回滚可能更有效。死锁检测可以使用innodb_tacklock_detect变量禁用

死锁日志分析

参考:https://stackoverflow.com/questions/72431047/understanding-innodb-deadlock-log

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1550782.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

MongoDB 工具包安装(mongodb-database-tools)

首先到官网下载工具包&#xff0c;进入下面页面&#xff0c;复制连接地址&#xff0c;使用wget下载 cd /usr/local/mongodb5.0.14/wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel70-x86_64-100.6.1.tgz 安装 tar -zxvf mongodb-database-tools-rhel70-…

Python库matplotlib之五

Python库matplotlib之五 小部件(widget)RangeSlider构造器APIs应用实列 TextBox构造器APIs应用实列 小部件(widget) 小部件(widget)可与任何GUI后端一起工作。所有这些小部件都要求预定义一个Axes实例&#xff0c;并将其作为第一个参数传递。 Matplotlib不会试图布局这些小部件…

LeetCode 热题 100 回顾2

干货分享&#xff0c;感谢您的阅读&#xff01;原文见&#xff1a;LeetCode 热题 100 回顾_力code热题100-CSDN博客 一、哈希部分 1.两数之和 &#xff08;简单&#xff09; 题目描述 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标…

自制CANTool_DBC_Layout仿制_布局读取Signal(三)

1、读取DBC中解析格式空格问题报错解决方法 原来解析方式&#xff1a;BO_ 258 EPS_CANFD_StrWhlASts: 8 Test 有的DBC中数据格式&#xff1a;BO_ 80 GW_50: 8 GW &#xff08;多了一个空格&#xff09; 解析匹配规则修订为&#xff1a; string MessageRegex "BO…

手机改IP地址怎么弄?全面解析与操作指南

在当今数字化时代&#xff0c;IP地址作为设备在网络中的唯一标识&#xff0c;其重要性不言而喻。有时候&#xff0c;出于隐私保护、网络访问需求或其他特定原因&#xff0c;我们可能需要更改手机的IP地址。然而&#xff0c;对于大多数普通用户来说&#xff0c;如何操作可能还是…

一文说完c++全部基础知识,IO流(二)

一、IO流 流、一连串连续不断的数据集合。 看下图&#xff0c;继承关系 using namespace 流类的构造函数 eg:ifstream::ifstream (const char* szFileName, int mode ios::in, int); #include <iostream> #include <fstream> using namespace std; int main()…

云计算 Cloud Computing

文章目录 1、云计算2、背景3、云计算的特点4、云计算的类型&#xff1a;按提供的服务划分5、云计算的类型&#xff1a;按部署的形式划分 1、云计算 定义&#xff1a; 云计算是一种按使用量付费的模式&#xff0c;这种模式提供可用的、便捷的、按需的网络访问&#xff0c;进入可…

0基础学习QT——配置开发环境

大纲 安装Qt配置Visual Studio 2022安装插件配置 测试 Qt框架&#xff0c;以其跨平台、高性能以及丰富的UI组件库而著称&#xff0c;是开发图形用户界面应用程序的理想选择。Visual Studio 2022提供了对Qt项目的深度支持&#xff0c;包括智能代码提示、代码导航、调试工具等&am…

矩阵奇异值

一、ATA 任给一个矩阵A&#xff0c;都有&#xff1a; ATA 为一个对称矩阵 例子&#xff1a;A为一个mn的矩阵&#xff0c;A的转置为一个nm的矩阵 对称矩阵的重要性质如下&#xff1a; ① 对称矩阵的特征值全为实数&#xff08;实数特征根&#xff09; ② 任意一个n阶对称矩阵…

基于微信小程序的旧衣回收系统

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码、微信小程序源码 精品专栏&#xff1a;…

C++ string的基本运用详细解剖

string的基本操作 一.与C语言中字符串的区别二.标准库中的string三.string中常用接口的介绍1.string中常用的构造函数2.string类对象的容量操作函数3.string类对象的访问及遍历操作4.string类对象的修改操作5.string类的非成员函数6.string中的其他一些操作 一.与C语言中字符串…

Windows下VScode快速配置OpenCV开发环境 【快乐篇】

1.前言 由于业务需要本人通过vscode快速迭代配置了一版OpenCV的开发环境&#xff0c;因为要快所以直接用大佬们构建好的openCV就行。本人这里是64位的Window11下配置的。 2.前置工具 vscode IDE工具 3.安装VScode插件 C/CC/C Extension PackC/C ThemesCMakeCMake Tools 4.…

云服务架构与华为云架构

目录 1.云服务架构是什么&#xff1f; 1.1 云服务模型 1.2 云部署模型 1.3 云服务架构的组件 1.4 云服务架构模式 1.5 关键设计考虑 1.6 优势 1.7 常见的云服务架构实践 2.华为云架构 2.1 华为云服务模型 2.2 华为云部署模型 2.3 华为云服务架构的核心组件 2.4 华…

MySQL-MySQL访问

文章目录 前言一、使用步骤1.MYSQL *mysql_init(MYSQL *mysql);2.MYSQL *mysql_real_connectint mysql_query(MYSQL *mysql, const char *q);MYSQL_RES *mysql_store_result(MYSQL *mysql);my_ulonglong mysql_num_rows(MYSQL_RES *res);unsigned int mysql_num_fields(MYSQL_R…

如何从相机的记忆棒(存储卡)中恢复丢失照片

当您意识到不小心从存储卡中删除了照片&#xff0c;或者错误地格式化了相机的记忆棒时&#xff0c;这些是您会大喊的前两个词。这是一种常见的情况&#xff0c;每个人在他们的一生中都会面临它。幸运的是&#xff0c;有一些方法可以从相机的 RAW 记忆棒&#xff08;存储卡&…

PyGWalker:让你的Pandas数据可视化更简单,快速创建数据可视化网站

1、PyGWalker应用: 在数据分析的过程中,数据的探索和可视化是至关重要的环节,如何高效地将分析结果展示给团队、客户,甚至是公众,是很多数据分析师和开发者面临的挑战,接下来介绍的两大工具组合——PyGWalker与Streamlit,可以帮助用户轻松解决这个问题,即使没有复杂的代…

Tomcat架构解析

Tomcat: 是基于JAVA语言的轻量级应用服务器&#xff0c;是一款完全开源免费的Servlet服务器实现。 1. 总体设计 socket: 其实就是操作系统提供给程序员操作“网络协议栈”的接口&#xff0c;你能通过socket的接口&#xff0c;来控制协议&#xff0c;实现网络通信&#xff0c;达…

JAVA开源项目 新闻推荐系统 计算机毕业设计

本文项目编号 T 056 &#xff0c;文末自助获取源码 \color{red}{T056&#xff0c;文末自助获取源码} T056&#xff0c;文末自助获取源码 目录 一、系统介绍二、演示录屏三、启动教程四、功能截图五、文案资料5.1 选题背景5.2 国内外研究现状5.3 可行性分析 六、核心代码6.1 查…

大数据-153 Apache Druid 案例 从 Kafka 中加载数据并分析

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; 目前已经更新到了&#xff1a; Hadoop&#xff08;已更完&#xff09;HDFS&#xff08;已更完&#xff09;MapReduce&#xff08;已更完&am…

【HTML5】html5开篇基础(5)

1.❤️❤️前言~&#x1f973;&#x1f389;&#x1f389;&#x1f389; Hello, Hello~ 亲爱的朋友们&#x1f44b;&#x1f44b;&#xff0c;这里是E绵绵呀✍️✍️。 如果你喜欢这篇文章&#xff0c;请别吝啬你的点赞❤️❤️和收藏&#x1f4d6;&#x1f4d6;。如果你对我的…