dev c++调试怎么看变量的值_利用GDB调试 MSQL

原创 张政俊 老叶茶馆

来自专辑

MySQL修行

作者:张政俊

就职于中欧基金,知数堂粉丝,数据库爱好者,熟悉RDBMS、nosql、new sql等各类数据库。

啃完O'reilly的《高性能mysql》、姜老师的《MySQL技术内幕》,再加上个2,3年的实战经验,就基本可以成为一名能独立处理问题的DBA了。但有些时候遇到些很刁钻的疑难杂症的话,那就束手无策了。

所以要想技术水平更进一步的话,源码调试是避不开的。

GDB 简介

GDB 是 Linux 系统中,非常常见的调试工具,它有以下功能:

  • Start your program, specifying anything that might affect its behavior.
  • Make your program stop on specified conditions.
  • Examine what has happened, when your program has stopped.
  • Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.

常用的参数命令:

  • info threads:查看全部线程
  • thread n:指定某个线程
  • b:在某处打断点
  • c:继续往下走
  • s:执行一行代码,如果代码函数调用,则进入函数
  • n:执行一行代码,函数调用不进入
  • p:打印某个变量值
  • list:打印代码的文本信息
  • bt:查看某个线程的栈帧
  • info b:查看当前所有断点信息

调试环境搭建

直接在 linux 下面使用 gdb,这种应该是目前市面上最简单有效的方式。

1. 安装gdb

yum install -y cmake make gcc gcc-c++ ncurses-devel bison gdb

2. 下载、解压源码

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.25.tar.gztar zxvf mysql-boost-5.7.25.tar.gzmkdir -p /gdb/mysql/mkdir -p /gdb/data/

3. 安装数据库

cmake -DCMAKE_INSTALL_PREFIX=/gdb/mysql/ -DMYSQL_DATADIR=/gdb/data/ -DSYSCONFDIR=/gdb/mysql/ -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/gdb/mysql/mysql3.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql -DWITH_BINLOG_PREALLOC=ON -DWITH_BOOST=/gdb/mysql-5.7.25/boost/boost_1_59_0 -DWITH_DEBUG=1

-DWITH_DEBUG=1 是最关键的,它的作用是开启DBUG

make&&make install

4. 初始化数据库

vim /etc/my.cnf    #简易配置下my.cnf文件    [client]    port            = 3306    socket          = /gdb/data/mysqld.sock    [mysqld]    port            = 3306    socket          =/gdb/data/mysqld.sock    skip-external-locking    key_buffer_size = 8M    max_allowed_packet = 1M    table_open_cache = 64    sort_buffer_size = 512K    net_buffer_length = 8K    read_buffer_size = 128K    read_rnd_buffer_size = 256K    myisam_sort_buffer_size = 8M    lower_case_table_names=1    innodb_buffer_pool_size=300M    log-bin=mysql-bin    character_set_server=utf8    binlog_format=row    datadir=/gdb/data    log-error =/gdb/data/error.log    pid-file = /gdb/data/mysql.pid    innodb_log_file_size=512M    innodb_log_files_in_group = 3    sql_mode=''    autocommit=1    server-id       = 1    max_connections=1500    wait_timeout=70    interactive_timeout=70    skip-name-resolve    [mysqldump]    quick    max_allowed_packet = 16M    [myisamchk]    key_buffer_size = 20M    sort_buffer_size = 20M    read_buffer = 2M    write_buffer = 2M

5. 启动数据库

赋权,以便mysql用户有权限在该目录下生成文件:
chown -R mysql:mysql /gdb/data

初始化数据库命令:

cd /gdb/mysql/bin./mysqld --initialize --user=mysql --basedir=/gdb/mysql --datadir=/gdb/data

启动数据库:

cd /gdb/mysql/support-files ./mysql.server start

insert 断点调试

1. 查看 mysql 进程 id

[root@ops sql]# ps aux | grep mysqlroot       629  0.0  0.0 112724   972 pts/2    S+   14:52   0:00 grep -E --color=auto mysqlroot     20926  0.0  0.0 113312  1628 pts/0    S    11:15   0:00 /bin/sh /gdb/mysql/bin/mysqld_safe --datadir=/gdb/data --pid-file=/gdb/data/mysql.pidmysql    21357  0.0  5.8 1740820 223820 pts/0  Sl   11:15   0:01 /gdb/mysql/bin/mysqld --basedir=/gdb/mysql --datadir=/gdb/data --plugin-dir=/gdb/mysql/lib/plugin --user=mysql --log-error=/gdb/data/error.log --pid-file=/gdb/data/mysql.pid --socket=/gdb/data/mysqld.sock --port=3306

可以看到此时mysql的进程号为:20926

2. gdb 中 attach mysql 进程

[root@ops ~]# gdbGNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7Copyright (C) 2013 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.  Type "show copying"and "show warranty" for details.This GDB was configured as "x86_64-redhat-linux-gnu".For bug reporting instructions, please see:.(gdb) attach 21357Attaching to process 21357Reading symbols from /gdb/mysql/bin/mysqld...done.Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.[New LWP 21617][New LWP 21387][New LWP 21386][New LWP 21384][New LWP 21383][New LWP 21382][New LWP 21381][New LWP 21380][New LWP 21379][New LWP 21378][New LWP 21377][New LWP 21376][New LWP 21375][New LWP 21374][New LWP 21373][New LWP 21369][New LWP 21368][New LWP 21367][New LWP 21366][New LWP 21365][New LWP 21364][New LWP 21363][New LWP 21362][New LWP 21361][New LWP 21360][New LWP 21359][New LWP 21358][Thread debugging using libthread_db enabled]Using host libthread_db library "/lib64/libthread_db.so.1".Loaded symbols for /lib64/libpthread.so.0Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/libcrypt.so.1Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/libdl.so.2Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/librt.so.1Reading symbols from /lib64/libstdc++.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libstdc++.so.6Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libm.so.6Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/libgcc_s.so.1Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libc.so.6Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/ld-linux-x86-64.so.2Reading symbols from /lib64/libfreebl3.so...Reading symbols from /lib64/libfreebl3.so...(no debugging symbols found)...done.(no debugging symbols found)...done.Loaded symbols for /lib64/libfreebl3.soReading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/libnss_files.so.2Reading symbols from /lib64/libnss_sss.so.2...Reading symbols from /lib64/libnss_sss.so.2...(no debugging symbols found)...done.(no debugging symbols found)...done.Loaded symbols for /lib64/libnss_sss.so.20x00002b15ce803f0d in poll () from /lib64/libc.so.6Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 nss-softokn-freebl-3.34.0-2.el7.x86_64 sssd-client-1.16.0-19.el7.x86_64(gdb)

3. 找到断点

这次看的是 insert 插入的流程,找到 sql_insert.cc 文件:

399263429430d4d671d233ab00a8cfe2.png

源码中的函数为:Sql_cmd_insert::mysql_insert

4. 设置断点

(gdb) b Sql_cmd_insert::mysql_insertBreakpoint 1 at 0x175aed9: file /gdb/mysql-5.7.25/sql/sql_insert.cc, line 423.

然后查看下线程的栈帧:

(gdb) bt#0  0x00002b15ce803f0d in poll () from /lib64/libc.so.6#1  0x0000000001667f87 in Mysqld_socket_listener::listen_for_connection_event (this=0x3967430) at /gdb/mysql-5.7.25/sql/conn_handler/socket_connection.cc:852#2  0x0000000000eb15cc in Connection_acceptor::connection_event_loop (this=0x4f882e0) at /gdb/mysql-5.7.25/sql/conn_handler/connection_acceptor.h:66#3  0x0000000000ea904a in mysqld_main (argc=38, argv=0x383c248) at /gdb/mysql-5.7.25/sql/mysqld.cc:5149#4  0x0000000000ea01bd in main (argc=9, argv=0x7ffc73765b88) at /gdb/mysql-5.7.25/sql/main.cc:25

5. 数据库登陆

gdb断点设置完后,起个新的数据库连接:

0fefff65ac386584834675dca9e0caaa.png

会发现此时无法登陆,在gdb中执行next:

(gdb) nSingle stepping until exit from function poll,which has no line number information.Mysqld_socket_listener::listen_for_connection_event (this=0x3967430) at /gdb/mysql-5.7.25/sql/conn_handler/socket_connection.cc:859859   if (retval < 0 && socket_errno != SOCKET_EINTR)

通过输出可以知道数据库处于获取系统 socket 状态。接下来需要跳过的步骤有些多,我们直接使用 continue (直接到下一段可执行代码)

(gdb) cContinuing.

新起客户端连接成功:

[root@ops bin]# mysql -uroot -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or g.Your MySQL connection id is 14Server version: 5.7.25-debug-log Source distributionType 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql>

6. 数据库插入

插入操作前,切换schema和查询都是没问题的:

mysql> use gdbDatabase changedmysql> show tables;+---------------+| Tables_in_gdb |+---------------+| test          |+---------------+1 row in set (0.00 sec)mysql> select * from test;+------+| id   |+------+|    1 ||    2 |+------+2 rows in set (0.00 sec)

插入一条 id=3 的数据,出现了等待:

mysql> insert into test values (3);

7. 分析断点信息

断点触发,如下:

(gdb) cContinuing.[Switching to Thread 0x2b15faf02700 (LWP 21617)]Breakpoint 1, Sql_cmd_insert::mysql_insert (this=0x2b1614008348, thd=0x2b1614003af0, table_list=0x2b1614007db8) at /gdb/mysql-5.7.25/sql/sql_insert.cc:423423   DBUG_ENTER("mysql_insert");

bt 命令展示栈帧:

(gdb) bt#0  Sql_cmd_insert::mysql_insert (this=0x2b1614008348, thd=0x2b1614003af0, table_list=0x2b1614007db8) at /gdb/mysql-5.7.25/sql/sql_insert.cc:423#1  0x000000000176256e in Sql_cmd_insert::execute (this=0x2b1614008348, thd=0x2b1614003af0) at /gdb/mysql-5.7.25/sql/sql_insert.cc:3118#2  0x000000000153b093 in mysql_execute_command (thd=0x2b1614003af0, first_level=true) at /gdb/mysql-5.7.25/sql/sql_parse.cc:3596#3  0x0000000001540820 in mysql_parse (thd=0x2b1614003af0, parser_state=0x2b15faf01690) at /gdb/mysql-5.7.25/sql/sql_parse.cc:5570#4  0x0000000001536131 in dispatch_command (thd=0x2b1614003af0, com_data=0x2b15faf01df0, command=COM_QUERY) at /gdb/mysql-5.7.25/sql/sql_parse.cc:1484#5  0x0000000001534f9a in do_command (thd=0x2b1614003af0) at /gdb/mysql-5.7.25/sql/sql_parse.cc:1025#6  0x00000000016658dc in handle_connection (arg=0x39610f0) at /gdb/mysql-5.7.25/sql/conn_handler/connection_handler_per_thread.cc:306#7  0x0000000001ced592 in pfs_spawn_thread (arg=0x5508e50) at /gdb/mysql-5.7.25/storage/perfschema/pfs.cc:2190#8  0x00002b15cd699e25 in start_thread () from /lib64/libpthread.so.0#9  0x00002b15ce80ebad in clone () from /lib64/libc.so.6

接下来输入 n 会逐行输出,我们这里直接 continue,阻塞的 insert 也完成了:

mysql> insert into test values (3);Query OK, 1 row affected (2 min 49.57 sec)

发布一个特殊版本的mysql

有些函数所在源码的位置比较好理解,比如上面的 insert 功能,或者 delete 功能。是不是可以通过修改 delete 函数,打包一个数据永不会被删除的 mysql 呢?

定位函数位置

先追踪mysql进程:

(gdb) attach 21357Attaching to process 21357Reading symbols from /gdb/mysql/bin/mysqld...done.Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.[New LWP 5584][New LWP 5583][New LWP 21617][New LWP 21387][New LWP 21386][New LWP 21384][New LWP 21383][New LWP 21382][New LWP 21381][New LWP 21380][New LWP 21379][New LWP 21378][New LWP 21377][New LWP 21376][New LWP 21375][New LWP 21374][New LWP 21373][New LWP 21369][New LWP 21368][New LWP 21367][New LWP 21366][New LWP 21365][New LWP 21364][New LWP 21363][New LWP 21362][New LWP 21361][New LWP 21360][New LWP 21359][New LWP 21358][Thread debugging using libthread_db enabled]Using host libthread_db library "/lib64/libthread_db.so.1".Loaded symbols for /lib64/libpthread.so.0Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/libcrypt.so.1Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/libdl.so.2Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/librt.so.1Reading symbols from /lib64/libstdc++.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libstdc++.so.6Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libm.so.6Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.Loaded symbols for /lib64/libgcc_s.so.1Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.Loaded symbols for /lib64/libc.so.6Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/ld-linux-x86-64.so.2Reading symbols from /lib64/libfreebl3.so...Reading symbols from /lib64/libfreebl3.so...(no debugging symbols found)...done.(no debugging symbols found)...done.Loaded symbols for /lib64/libfreebl3.soReading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.Loaded symbols for /lib64/libnss_files.so.2Reading symbols from /lib64/libnss_sss.so.2...Reading symbols from /lib64/libnss_sss.so.2...(no debugging symbols found)...done.(no debugging symbols found)...done.Loaded symbols for /lib64/libnss_sss.so.20x00002b15ce803f0d in poll () from /lib64/libc.so.6Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 nss-softokn-freebl-3.34.0-2.el7.x86_64 sssd-client-1.16.0-19.el7.x86_64

delete函数这里打上断点:

(gdb) b Sql_cmd_delete::mysql_deleteBreakpoint 1 at 0x175198b: file /gdb/mysql-5.7.25/sql/sql_delete.cc, line 50.

数据库执行delete语句触发断点:

mysql> delete from test where id =3;

gbk断点信息:

Breakpoint 1, Sql_cmd_delete::mysql_delete (this=0x2b16040020c8, thd=0x2b1604007e30, limit=18446744073709551615) at /gdb/mysql-5.7.25/sql/sql_delete.cc:5050    DBUG_ENTER("mysql_delete");

查看相关栈帧:

#0  Sql_cmd_delete::mysql_delete (this=0x2b16040020c8, thd=0x2b1604007e30, limit=18446744073709551615) at /gdb/mysql-5.7.25/sql/sql_delete.cc:50#1  0x0000000001755cc6 in Sql_cmd_delete::execute (this=0x2b16040020c8, thd=0x2b1604007e30) at /gdb/mysql-5.7.25/sql/sql_delete.cc:1392#2  0x000000000153b12f in mysql_execute_command (thd=0x2b1604007e30, first_level=true) at /gdb/mysql-5.7.25/sql/sql_parse.cc:3606#3  0x0000000001540820 in mysql_parse (thd=0x2b1604007e30, parser_state=0x2b15faf43690) at /gdb/mysql-5.7.25/sql/sql_parse.cc:5570#4  0x0000000001536131 in dispatch_command (thd=0x2b1604007e30, com_data=0x2b15faf43df0, command=COM_QUERY) at /gdb/mysql-5.7.25/sql/sql_parse.cc:1484#5  0x0000000001534f9a in do_command (thd=0x2b1604007e30) at /gdb/mysql-5.7.25/sql/sql_parse.cc:1025#6  0x00000000016658dc in handle_connection (arg=0x54b6510) at /gdb/mysql-5.7.25/sql/conn_handler/connection_handler_per_thread.cc:306#7  0x0000000001ced592 in pfs_spawn_thread (arg=0x5508e50) at /gdb/mysql-5.7.25/storage/perfschema/pfs.cc:2190#8  0x00002b15cd699e25 in start_thread () from /lib64/libpthread.so.0#9  0x00002b15ce80ebad in clone () from /lib64/libc.so.6

修改源码

可以看到 #1 是 Sql_cmd_delete::execute ,这个就是 delete 处理的函数,去源代码中找到相应函数:

d71c90e2337f8b896a9a91b6000f30ee.png

把正真实现删除逻辑的代码给注释掉,返回的 res 值直接赋成 true:

bool Sql_cmd_delete::execute(THD *thd){  DBUG_ASSERT(thd->lex->sql_command == SQLCOM_DELETE);  LEX *const lex= thd->lex;  SELECT_LEX *const select_lex= lex->select_lex;  SELECT_LEX_UNIT *const unit= lex->unit;  TABLE_LIST *const first_table= select_lex->get_table_list();  TABLE_LIST *const all_tables= first_table;  if (delete_precheck(thd, all_tables))    return true;  DBUG_ASSERT(select_lex->offset_limit == 0);  unit->set_limit(select_lex);  /* Push ignore / strict error handler */  Ignore_error_handler ignore_handler;  Strict_error_handler strict_handler;  if (thd->lex->is_ignore())    thd->push_internal_handler(&ignore_handler);  else if (thd->is_strict_mode())    thd->push_internal_handler(&strict_handler);/*注释以下删除逻辑的代码*//*  MYSQL_DELETE_START(const_cast(thd->query().str));  bool res = mysql_delete(thd, unit->select_limit_cnt);  MYSQL_DELETE_DONE(res, (ulong) thd->get_row_count_func());*//*直接返回true*/  bool res =true;  /* Pop ignore / strict error handler */if (thd->lex->is_ignore() || thd->is_strict_mode())    thd->pop_internal_handler();  return res;}

然后上文的方法去重新编译mysql,启动后就会发现delete语句无法删除数据了。

调试总结

如果想深入学习源码,就可以从栈帧出发,但是这是基于知道函数接口功能的前提下进行的,如果不知道某个功能会调用什么函数,断点调试就很难进行了。

直接去读完 mysql 所有源码,成本太高,而且 mysql 的代码结构并不友好,耗时耗力不值得。最好的方案还是遇到问题时或针对特殊的一个功能点按需去寻找函数入口,然后逐步深入分析。

希望这篇文章可以帮到想接触mysql源码调试的同学,以后我遇到特殊的问题也会通过gdb去调试涉及的相关函数,大家可以持续关注~

全文完。

Enjoy MySQL :)

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

案例 自动办公_办公自动化案例教程(双色)(含微课)

办公自动化案例教程(双色)(含微课)ISBN:978-7-5165-1852-6作者&#xff1a;贺鑫 彭卫华 李胜华定价&#xff1a;48.00元出版社&#xff1a;航空工业出版社适用层次&#xff1a;通用出版日期&#xff1a;2020-05-01项目一 使用Word制作常用公文项目描述学习要点任务一 制作行政…

柱形图无数据可选中_Excel – 如何制作出上下层排列的柱形图?

如何将同一个数据表中的不同数据列排列成上下两层柱形图&#xff1f;案例&#xff1a;将下图 1 的数据表制作成柱形图&#xff0c;要求将销量和利润的柱形分成两个图表上下排列。效果如下图 2 所示。解决方案&#xff1a;1. 选中整个数据表区域 --> 选择菜单栏的“插入”--&…

html画布360图案填充_在Photoshop中创建带有图案的抽象设计

效果图知识点&#xff1a;应用选区工具结合图层混合模式和混合选项&#xff0c;创造出唯美的抽象类画册 效果设计本身由一系列同心圆组成&#xff0c;每组的大小各不相同。每个圆都有6个核心色板的底色&#xff0c;然后渐变和图案填充会增加细节和深度。我们需要创建图案填充。…

emd实现信息隐藏_EMD算法原理与实现

欢迎关注我们&#xff0c;选择加"星标"或“置顶”更多技术&#xff0c;第一时间送达SSVEP信号中含有自发脑电和大量外界干扰信号&#xff0c;属于典型的非线性非平稳信号。传统的滤波方法通常不满足对非线性非平稳分析的条件&#xff0c;1998年黄鄂提出希尔伯特黄变换…

转为yaml python_python 如何使用HttpRunner做接口自动化测试

作者&#xff1a;星安果 来源&#xff1a;AirPython1. 前言原始测试金子塔包含 3 层&#xff0c;分别是&#xff1a;UI 自动化测试、接口服务测试、单元测试其中&#xff0c;单元测试是对软件的最小可测试单元进行检查和验证&#xff0c;也是产生效率最大的一项测试接口服务测试…

eq值 推荐算法_利用 SVD 实现协同过滤推荐算法

奇异值分解(Singular Value Decomposition&#xff0c;以下简称SVD)是在机器学习领域广泛应用的算法&#xff0c;它不光可以用于降维算法中的特征分解&#xff0c;还可以用于推荐系统&#xff0c;以及自然语言处理等领域。优点&#xff1a;简化数据&#xff0c;去除噪声&#x…

打开数据库_打开这份指南,数据库运维也能优雅、简单!

对于常规数据库的运维监控来说&#xff0c;如何能够快速简洁的发现问题&#xff0c;直达问题本质并解决常见问题&#xff0c;是 Bethune 的安身立命之本。简约&#xff0c;优雅&#xff0c;专业&#xff0c;直抵本心&#xff0c;这是用户对 Bethune 的评价。Bethune X 功能强大…

mysql集群_MySQL集群

MySQL集群搭建之主从复制: 主从复制原理: 从库生成两个线程,一个I/O线程,一个SQL线程; i/o线程去请求主库 的binlog,并将得到的binlog日志写到relay log(中继日志) 文件中; 主库会生成一个 log dump 线程,用来给从库 i/o线程传binlog; SQL 线程,会读取relay log文件中…

mysql 数据库操作类_【数据库操作类】10个php操作数据库类下载

数据库(Database)操作是在开发过程中重要的组成部分&#xff0c;熟练掌握数据库的操作是开发人员必备的武器。PHP中文网为大家提供了各种封装好的php数据库操作类库&#xff0c;供大家下载和学习。相关mysql视频教程推荐&#xff1a;《mysql教程》php各种数据库操作类库下载PDO…

程序员需要知道的职场真相

关于面试谈薪&#xff1a; 1. 你值多少钱&#xff0c;不是由老板决定的&#xff0c;也不是由你自己的能力决定&#xff0c;而是由市场决定的。这个技术就你一个会&#xff0c;你说多少钱就多少钱。这个技术 100W人会&#xff0c;不好意思&#xff0c;肯定是公司在一定的时间内&…

QQ浏览器怎么同步通讯录?QQ浏览器同步通讯录的方法

QQ浏览器怎么同步通讯录&#xff1f;QQ浏览器同步通讯录的方法 qq浏览器是一款非常好用的手机服务软件&#xff0c;有很多用户都会使用这款软件作为自己的主流浏览器&#xff0c;相信已经有很多用户使用过这款软件了&#xff0c;这款软件的搜索功能非常的强大&#xff0c;有很多…

win10如何删除注册表残留文件

win10如何删除注册表残留文件?下面一起来看看如何操作吧。 1、按下“winr”打开运行&#xff0c;输入“regedit”&#xff0c;点击“确定”; 2、依次展开“HKEY_LOCAL_MACHINESOFTWAREMicrosoftwindowsCurrentVersionUninstall”; 3、在该子键下根据已卸载的应用程序软件图标…

jmeter连接mysql数据库驱动_十八、JMeter实战-JDBC连接MySQL数据库

前言连接数据库进行测试在工作中会比较常用&#xff0c;首先可以读取数据库的数据进行参数化、关联等&#xff0c;批量添加测试数据以及清理数据&#xff0c;还可以直接对SQL语句进行压测。一、基本介绍1. 首先第一步要导入mysql驱动包&#xff0c;放到jmeter/lib目录下&#x…

下如何查看mysql表单_Navicat 教程:如何进行表单查看

Navicat 表单查看方便表单查看、更新或删除数据&#xff0c;显示当前的记录&#xff1a;栏位名及其值。表单的弹出菜单包括这些功能&#xff1a;设置栏位值为 Null 或空白字符串、使用当前栏位值为筛选、设置表单查看格式及更多&#xff0c;导览栏可以快速切换记录、插入、更新…

怎么禁止开机启动nvidia

1、单击开始菜单&#xff0c;选择运行&#xff0c;打开运行后输入services.msc 确定。 2、打开本地服务后&#xff0c;在列表中找到NVIDIA Display Driver Service服务。 3、双击打开该服务&#xff0c;然后将NVIDIA Display Driver Service服务的启动类型设置为禁用&#x…

mysql insert 错误码_利用 MySQL 自身错误诊断区域-爱可生

原标题&#xff1a;利用 MySQL 自身错误诊断区域-爱可生背景本篇文章来源于今天客户问的一个问题。问题大概意思是&#xff1a;我正在从 Oracle 迁移到 MySQL&#xff0c;数据已经转换为单纯的 INSERT 语句。由于语句很多&#xff0c;每次导入的时候不知道怎么定位到错误的语句…

mac版crt8.0.2打开无响应怎么办_Mac电脑程序无响应怎么办?教你强制退出无响应程序...

Mac电脑运行时间长了&#xff0c;难免也会遇到程序卡死无响应的情况&#xff0c;可能是由于程序冲突、缓存不足或者一些bug等情况导致&#xff0c;这个时候我们就需要强制退出这个程序了&#xff0c;一起来看看如何强制退出无响应程序吧&#xff01;快捷键强制退出当前运行的应…

win7如何关闭密码保护共享

1、首先打开控制面板&#xff0c;选择用户账户和家庭安全。 2、其次点击用户账户。 3、然后选择管理其他账户。 4、接着点击Guest&#xff0c;点击启用。 5、之后关闭窗口&#xff0c;右击点击计算机&#xff0c;选择管理。 6、接着按顺序点击本地用户和组、用户&#xff0…

python英文字典小程序_python 小程序—三级菜单—循环和字典练习

程序中利用多级字典来存储三级菜单&#xff0c; 通过一系列while循环和for循环&#xff0c;实现了三级菜单的查询&#xff0c;选择&#xff0c;退回上级菜单&#xff0c;退出程序几个功能。缺点&#xff1a;程序语句过于重复&#xff0c;效率低。#-*-coding:utf-8-*-date{北京:…

win7电脑假死机怎么办

1、正在使用电脑&#xff0c;如果网页或一些页面卡住不动&#xff0c;我们首先要保持电脑的正常运行。这时候可以同时按WinD&#xff0c;可以马上回到桌面。然后尝试着刷新几次。 2、当回到桌面后&#xff0c;我们试着看看是不是运行的软件太多了&#xff0c;造成电脑运行不动…