当前位置: 首页 > news >正文

电商网站开发流程求个没封的网站2022

电商网站开发流程,求个没封的网站2022,企业门户网站制作价格怎么算,php网站安装好后后台无法登陆提示是500是怎么回事?1. exec_time 到底表示什么时间? MySQL binlog日志解析后,我们能看到会有 exec_time ,从字面意思理解这个记录的是执行时间,那这个记录的到底是单条sql的执行时间?还是事务的执行时间?下面通过测试来解读一…

1. exec_time 到底表示什么时间?

MySQL binlog日志解析后,我们能看到会有 exec_time= ,从字面意思理解这个记录的是执行时间,那这个记录的到底是单条sql的执行时间?还是事务的执行时间?下面通过测试来解读一下!

2.创建测试库表

mysql> create database test_shao;
Query OK, 1 row affected (0.03 sec)
mysql> use test_shao;
Database changed
mysql> create table test_1(id int not null auto_increment,primary key(id)) engine=innodb default charset=utf8mb4;
Query OK, 0 rows affected (0.03 sec)

3.RC隔离级别下 事务测试

show variables like 'transaction_isolation';
+-----------------------+----------------+
| Variable_name         | Value          |
+-----------------------+----------------+
| transaction_isolation | READ-COMMITTED |
+-----------------------+----------------+flush logs;
begin;
select count(*) from cmp_sys_1.message;
insert into test_1 select sleep(5);
select count(*) from cmp_sys_1.message;
insert into test_1 select sleep(10);
commit;mysql> flush logs;
Query OK, 0 rows affected (0.02 sec)mysql> begin;
Query OK, 0 rows affected (0.00 sec)mysql> select count(*) from cmp_sys_1.message;+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (45.24 sec)mysql> 
mysql> insert into test_1 select sleep(5);
Query OK, 1 row affected (5.00 sec)
Records: 1  Duplicates: 0  Warnings: 0mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (35.73 sec)mysql> insert into test_1 select sleep(10);
Query OK, 1 row affected (10.00 sec)
Records: 1  Duplicates: 0  Warnings: 0mysql> commit;
Query OK, 0 rows affected (0.00 sec)

4.解析第3步生成的主库binlog

show master status;
+-----------------+-----------+--------------+------------------+----------------------------------------------+
| File            | Position  | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                            |
+-----------------+-----------+--------------+------------------+----------------------------------------------+
| 3306-bin.000781 | 364155470 |              |                  | bc129ea5-5f01-11ed-ae48-fa163efcbfd5:1-17199 |
+-----------------+-----------+--------------+------------------+----------------------------------------------+
show variables like 'log_bin_basename';
+------------------+-----------------------------------+
| Variable_name    | Value                             |
+------------------+-----------------------------------+
| log_bin_basename | /app/mysql/mysql3306/log/3306-bin |
+------------------+-----------------------------------+mysqlbinlog --base64-output=decode-rows -vvv  3306-bin.000781 >3306-bin.000781.txt

5.解析第3步生成的从库binlog

6.RR 隔离级别下,statment binlog格式下事务测试(从库还是row格式binlog)

#RC隔离级别下,binlog_format不允许使用statment格式

mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)mysql> begin;
Query OK, 0 rows affected (0.00 sec)mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (38.37 sec)mysql> insert into test_1 select sleep(10);
Query OK, 1 row affected, 1 warning (10.05 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (26.10 sec)mysql> insert into test_1 select sleep(15);
Query OK, 1 row affected, 1 warning (15.00 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> commit;
Query OK, 0 rows affected (0.00 sec)

7.解析第6步主库binlog日志(binlog_format=statment)

8.解析第6步从库binlog(binlog_format=row)

9.主库从库隔离级别都为RR,binlog_format=row时事务测试

mysql> use test_shao;
Database changed
mysql> set transaction_isolation='REPEATABLE-READ';
Query OK, 0 rows affected (0.00 sec)mysql> set binlog_format='Statement';
Query OK, 0 rows affected (0.00 sec)mysql> select * from test_1;
+----+
| id |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
|  6 |
+----+
6 rows in set (0.00 sec)mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)mysql> begin;
Query OK, 0 rows affected (0.00 sec)mysql> select count(*) from cmp_sys_1.message;+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (29.95 sec)mysql> 
mysql> insert into test_1 select sleep(4);
Query OK, 1 row affected, 1 warning (4.02 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (24.32 sec)mysql> insert into test_1 select sleep(8);
Query OK, 1 row affected, 1 warning (8.00 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> commit;
Query OK, 0 rows affected (0.00 sec)

10.解析第9步中主库binlog日志(隔离级别RR,binlog_format=statment)

11.解析第9步中从库binlog日志(隔离级别RR,binlog_format=statment)

#对应的relaylog中记录的是statment格式的binlog

##从库记录的binlog格式依然为row格式是因为我只是设置了从库全局的隔离级别为RR,binlog_format=statment,但是我并没有重启从库io和sql线程。如果只是设置了从库的binlog_format=statment,主要为row格式的话,从库复制会报如下错误

   LAST_ERROR_MESSAGE: Worker 1 failed executing transaction 'bc129ea5-5f01-11ed-ae48-fa163efcbfd5:17204' at master log 3306-bin.000785, end_log_pos 488; Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'

设置主库从库隔离级别为RR,binlog_format格式为statment重启复制线程后测试结果如下:

mysql> use test_shao;
Database changed
mysql> set transaction_isolation='REPEATABLE-READ';
Query OK, 0 rows affected (0.00 sec)mysql> set binlog_format='Statement';
Query OK, 0 rows affected (0.00 sec)mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)mysql> begin;
Query OK, 0 rows affected (0.00 sec)mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (25.33 sec)mysql> insert into test_1 select sleep(2);
Query OK, 1 row affected, 1 warning (2.03 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> select count(*) from cmp_sys_1.message;
+----------+
| count(*) |
+----------+
| 62882460 |
+----------+
1 row in set (20.08 sec)mysql> insert into test_1 select sleep(4);
Query OK, 1 row affected, 1 warning (4.01 sec)
Records: 1  Duplicates: 0  Warnings: 1mysql> commit;
Query OK, 0 rows affected (0.00 sec)

主库binlog日志

从库binlog日志

#为什么从库binlog中第二个语句的exec_time时间为10s??从库statment binlog格式下,exec_time 到底如何记录时间,有待继续研究

http://www.yayakq.cn/news/446600/

相关文章:

  • wordpress 分享微信西昌新站seo
  • 大网站建设公司去哪找网站建设公司
  • 网站怎么在移动端推广阿里巴巴网站官网
  • 门户网站平台建设的经费商城网站开发报价单
  • 个人开网站大型门户网站建设哪家好
  • 建立应用网站无锡网站建设团队
  • 自适应网站m域名必须做301余姚网站建设服务
  • 网站首页建设建议宣化网站制作公司
  • 哇哈哈网站建设策划书徐州网络推广服务
  • 江西省网站建设成品视频直播软件推荐哪个好一点
  • 建设通网站是免费的吗建造个网站花多少钱
  • 商务网站建设兴田德润电话多少wordpress英文仿站
  • 外贸电商网站建设做网站线上线下价格混乱
  • 眉山网站优化做外贸的网站需要什么
  • 在线阅读小说网站怎么做oppo手机网站建设需求分析
  • 去哪学做网站网站一般怎么维护
  • 中牟高端网站建设柳州网站建设优化推广
  • 开发app和做网站如何建设网站pdf
  • 门户网站html下载国外展览展示设计网站
  • 襄阳谷城网站建设wordpress可以做电商吗
  • 兰州网站建设招聘创意设计广告
  • 高端h5网站在线网站代码生成器
  • 深圳企业网站制作wordpress 2018编辑器
  • 企业电子商务网站建设的必要性网站蜘蛛爬行统计
  • 小程序制作模板网站建设工业网站
  • 凡科建站提示网站建设中做网站前端要会什么
  • 建立网站步骤网站的个人网盘怎么做
  • 贵州小城镇建设网站怀化 优化营商环境
  • 北京网站建设公司排行榜简述搜索引擎优化
  • 沧州建设网站的公司宁波网站建设团队哪家好