利用binlog2sql闪回丢失数据
ns-notepc399+jujun@ns-notepc399 MINGW64 /d/vagrant
$ git clone https://github.com/danfengcao/binlog2sql.git && cd binlog2sql
Cloning into 'binlog2sql'...
remote: Counting objects: , done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 142.05 KiB | 108.00 KiB/s, done.
Resolving deltas: % (/), done.
ns-notepc399+jujun@ns-notepc399 MINGW64 /d/vagrant/binlog2sql (master)
[root@zlm3 :: /vagrant/pip-10.0.]
#pwd
/vagrant/pip-10.0. [root@zlm3 :: /vagrant/pip-10.0.]
#ls -l
total
-rwxrwxrwx vagrant vagrant Jun : AUTHORS.txt
drwxrwxrwx vagrant vagrant Jun : build
drwxrwxrwx vagrant vagrant Jun : dist
drwxrwxrwx vagrant vagrant Apr : docs
-rwxrwxrwx vagrant vagrant Jun : LICENSE.txt
-rwxrwxrwx vagrant vagrant Jun : MANIFEST.in
-rwxrwxrwx vagrant vagrant Jun : NEWS.rst
-rwxrwxrwx vagrant vagrant Jun : PKG-INFO
-rwxrwxrwx vagrant vagrant Jun : pyproject.toml
-rwxrwxrwx vagrant vagrant Jun : README.rst
-rwxrwxrwx vagrant vagrant Jun : setup.cfg
-rwxrwxrwx vagrant vagrant Jun : setup.py
drwxrwxrwx vagrant vagrant Apr : src [root@zlm3 :: /vagrant/pip-10.0.]
#python install setup.py
python: can't open file 'install': [Errno 2] No such file or directory [root@zlm3 :: /vagrant/pip-10.0.]
#python setup.py install
/usr/lib64/python2./distutils/dist.py:: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to src/pip.egg-info/requires.txt
writing src/pip.egg-info/PKG-INFO
writing top-level names to src/pip.egg-info/top_level.txt
writing dependency_links to src/pip.egg-info/dependency_links.txt
writing entry points to src/pip.egg-info/entry_points.txt
reading manifest file 'src/pip.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
... -- Here,i omitted the output 'cause too many rows.
[root@zlm3 :: /root/binlog2sql]
#pwd
/vagrant/binlog2sql [root@zlm3 :: /root/binlog2sql]
#ls -l
total
drwxrwxrwx root root Jun : binlog2sql
drwxrwxrwx root root Jun : example
-rwxrwxrwx root root Jun : LICENSE
-rwxrwxrwx root root Jun : README.md
-rwxrwxrwx root root Jun : requirements.txt
drwxrwxrwx root root Jun : tests [root@zlm3 :: /root/binlog2sql]
#cat requirements.txt
PyMySQL==0.7.
wheel==0.29.
mysql-replication==0.13 [root@zlm3 :: /root/binlog2sql]
#pip install -r requirements.txt
Collecting PyMySQL==0.7. (from -r requirements.txt (line ))
Downloading https://files.pythonhosted.org/packages/c6/42/c54c280d8418039bd2f61284f99cb6d9e0eae80383fc72ceb6eac67855fe/PyMySQL-0.7.11-py2.py3-none-any.whl (78kB)
% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 81kB 145kB/s
Collecting wheel==0.29. (from -r requirements.txt (line ))
Downloading https://files.pythonhosted.org/packages/8a/e9/8468cd68b582b06ef554be0b96b59f59779627131aad48f8a5bce4b13450/wheel-0.29.0-py2.py3-none-any.whl (66kB)
% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 71kB 356kB/s
Collecting mysql-replication==0.13 (from -r requirements.txt (line ))
Downloading https://files.pythonhosted.org/packages/dd/23/384047702e694139e9fe75a8ba7ad007e8942fd119ebadabc32ce19f70f2/mysql-replication-0.13.tar.gz
Installing collected packages: PyMySQL, wheel, mysql-replication
Running setup.py install for mysql-replication ... done
Successfully installed PyMySQL-0.7. mysql-replication-0.13 wheel-0.29. [root@zlm3 :: /root/binlog2sql]
#
(root@localhost mysql3306.sock)[zlm]::>create table flash_test(
-> id int unsigned not null auto_increment,
-> code bigint unsigned not null default '',
-> primary key(id)
-> ) engine=innodb charset utf8mb4;
Query OK, rows affected (0.02 sec) (root@localhost mysql3306.sock)[zlm]::>delimiter $$
(root@localhost mysql3306.sock)[zlm]::>create procedure pro_insert (count int)
-> begin
-> declare i int unsigned default ;
-> start transaction;
-> while i < count do
-> insert into flash_test(code) values(i);
-> set i=i+;
-> end while;
-> commit;
-> end;
-> $$
Query OK, rows affected (0.00 sec) (root@localhost mysql3306.sock)[zlm]::>delimiter ;
(root@localhost mysql3306.sock)[zlm]::>call pro_insert();
Query OK, rows affected (0.33 sec) (root@localhost mysql3306.sock)[zlm]::>select count(*) from flash_test;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.01 sec) (root@localhost mysql3306.sock)[zlm]::>select * from flash_test limit ;
+----+------+
| id | code |
+----+------+
| | |
| | |
| | |
| | |
| | |
+----+------+
rows in set (0.00 sec) (root@localhost mysql3306.sock)[zlm]::>
(root@localhost mysql3306.sock)[zlm]::>show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin. | |
| mysql-bin. | |
| mysql-bin. | |
+------------------+-----------+
rows in set (0.00 sec) (root@localhost mysql3306.sock)[zlm]::>flush logs;
Query OK, rows affected (0.02 sec) (root@localhost mysql3306.sock)[zlm]::>delete from flash_test;
Query OK, rows affected (0.05 sec) (root@localhost mysql3306.sock)[zlm]::>select count(*) from flash_test;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.00 sec) (root@localhost mysql3306.sock)[zlm]::>show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin. | |
| mysql-bin. | |
| mysql-bin. | |
| mysql-bin. | |
+------------------+-----------+
rows in set (0.00 sec) (root@localhost mysql3306.sock)[zlm]::>
[root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000004'
Traceback (most recent call last):
File "binlog2sql.py", line , in <module>
back_interval=args.back_interval, only_dml=args.only_dml, sql_type=args.sql_type)
File "binlog2sql.py", line , in __init__
self.connection = pymysql.connect(**self.conn_setting)
File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line , in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in __init__
self.connect()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in connect
self._request_authentication()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in _request_authentication
auth_packet = self._read_packet()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in _read_packet
packet.check_error()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in check_error
err.raise_mysql_exception(self._data)
File "/usr/lib/python2.7/site-packages/pymysql/err.py", line , in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (, u"Access denied for user 'root'@'zlm3' (using password: YES)") --It seems the connection failure. [root@zlm3 :: ~/binlog2sql/binlog2sql]
#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-log MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. (root@localhost mysql3306.sock)[(none)]::>alter user 'root'@'192.168.1.102' identified by 'Passw0rd';
ERROR (HY000): Operation ALTER USER failed for 'root'@'192.168.1.102'
(root@localhost mysql3306.sock)[(none)]::>create user 'root'@'192.168.1.102' identified by 'Passw0rd';
Query OK, rows affected (0.00 sec) (root@localhost mysql3306.sock)[(none)]::>exit
Bye [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000004'
Traceback (most recent call last):
File "binlog2sql.py", line , in <module>
back_interval=args.back_interval, only_dml=args.only_dml, sql_type=args.sql_type)
File "binlog2sql.py", line , in __init__
cursor.execute("SHOW MASTER STATUS")
File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line , in execute
result = self._query(query)
File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line , in _query
conn.query(q)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in _read_query_result
result.read()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in read
first_packet = self.connection._read_packet()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in _read_packet
packet.check_error()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line , in check_error
err.raise_mysql_exception(self._data)
File "/usr/lib/python2.7/site-packages/pymysql/err.py", line , in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (, u'Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation') --The user 'root'@'192.168.1.102' is short of imperative privileges. [root@zlm3 :: ~/binlog2sql/binlog2sql]
#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-log MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. (root@localhost mysql3306.sock)[(none)]::>grant select,replication slave,replication client on *.* to 'root'@'192.168.1.102';
Query OK, rows affected (0.00 sec) (root@localhost mysql3306.sock)[(none)]::>exit
Bye [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000004'
CREATE USER 'root'@'192.168.1.102' IDENTIFIED WITH 'mysql_native_password' AS '*DDFB542AA0BD1D251995D81AEBEB96DEEAD1132F';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'root'@'192.168.1.102'; [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000003'
CREATE USER 'repl'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*872ECE72A7EBAC6A183C90D7043D5F359BD85A9E';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%';
USE zlm;
create table flash_test(
id int unsigned not null auto_increment,
code bigint unsigned not null default '',
primary key(id)
) engine=innodb charset utf8mb4;
USE zlm;
CREATE DEFINER=`root`@`localhost` PROCEDURE `pro_insert`(count int)
begin
declare i int unsigned default ;
start transaction;
while i < count do
insert into flash_test(code) values(i);
set i=i+;
end while;
commit;
end; [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000004' --only-dml --sql-typedelete --stop-never > flashback.sql
usage: binlog2sql.py [-h HOST] [-u USER] [-p PASSWORD] [-P PORT]
[--start-file START_FILE] [--start-position START_POS]
[--stop-file END_FILE] [--stop-position END_POS]
[--start-datetime START_TIME] [--stop-datetime STOP_TIME]
[--stop-never] [--help] [-d [DATABASES [DATABASES ...]]]
[-t [TABLES [TABLES ...]]] [--only-dml]
[--sql-type [SQL_TYPE [SQL_TYPE ...]]] [-K] [-B]
[--back-interval BACK_INTERVAL]
binlog2sql.py: error: unrecognized arguments: --sql-typedelete [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000004' --only-dml --sql-type delete --stop-never > flashback.sql [root@zlm3 :: ~/binlog2sql/binlog2sql]
#cat flashback.sql [root@zlm3 :: ~/binlog2sql/binlog2sql]
#ls -l
total
-rwxrwxrwx root root Jun : binlog2sql.py
-rwxrwxrwx root root Jun : binlog2sql_util.py
-rw-r--r-- root root Jun : binlog2sql_util.pyc
-rw-r--r-- root root Jun : flashback.sql
-rwxrwxrwx root root Jun : __init__.py [root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='mysql-bin.000003' --only-dml --sql-type delete --stop-never > flashback.sql [root@zlm3 :: ~/binlog2sql/binlog2sql]
#cat flashback.sql [root@zlm3 :: ~/binlog2sql/binlog2sql]
#
[root@zlm3 :: ~/binlog2sql/binlog2sql]
#mysqlbinlog -vv --base64-output=decode-rows /data/mysql/mysql3306/logs/mysql-bin. > flashback1.sql [root@zlm3 :: ~/binlog2sql/binlog2sql]
#ls -l
total
-rwxrwxrwx root root Jun : binlog2sql.py
-rwxrwxrwx root root Jun : binlog2sql_util.py
-rw-r--r-- root root Jun : binlog2sql_util.pyc
-rw-r--r-- root root Jun : flashback1.sql
-rw-r--r-- root root Jun : flashback.sql
-rwxrwxrwx root root Jun : __init__.py [root@zlm3 :: ~/binlog2sql/binlog2sql]
#cat flashback1.sql | sed -n '1,100p'
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at
# :: server id end_log_pos CRC32 0xea71a6c0 Start: binlog v , server v 5.7.-log created ::
# Warning: this binlog is either in use or was not closed properly.
# at
# :: server id end_log_pos CRC32 0x7fe5f98f Previous-GTIDs
# 5c77c31b-4add-11e8-81e2-080027de0e0e:-
# at
# :: server id end_log_pos CRC32 0x7792ab23 GTID last_committed= sequence_number= rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= '5c77c31b-4add-11e8-81e2-080027de0e0e:13'/*!*/;
# at
# :: server id end_log_pos CRC32 0x3eb43079 Query thread_id= exec_time= error_code=
SET TIMESTAMP=/*!*/;
SET @@session.pseudo_thread_id=/*!*/;
SET @@session.foreign_key_checks=, @@session.sql_auto_is_null=, @@session.unique_checks=, @@session.autocommit=/*!*/;
SET @@session.sql_mode=/*!*/;
SET @@session.auto_increment_increment=, @@session.auto_increment_offset=/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=,@@session.collation_connection=,@@session.collation_server=/*!*/;
SET @@session.lc_time_names=/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at
# :: server id end_log_pos CRC32 0x31c37710 Table_map: `zlm`.`flash_test` mapped to number
# at
# :: server id end_log_pos CRC32 0xd8a33ccb Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x1105fcdc Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x4702cdba Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0xf49afbfa Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x8fc2a48e Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x947c8ca2 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x4d1b4f53 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x76275b27 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x99c0b33c Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x132f757d Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x047a5f63 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0xf5026c08 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0xd58c93f3 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x8a7ea487 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0xe0450750 Delete_rows: table id
# at
# :: server id end_log_pos CRC32 0x336c7539 Delete_rows: table id flags: STMT_END_F
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### DELETE FROM `zlm`.`flash_test`
### WHERE
### @= /* INT meta=0 nullable=0 is_null=0 */
### @= /* LONGINT meta=0 nullable=0 is_null=0 */ -- This is the deletion of record no. in the original table "flash_table". [root@zlm3 :: ~/binlog2sql/binlog2sql]
#
[root@zlm3 :: ~/binlog2sql/binlog2sql]
#python binlog2sql.py -h192.168.1. -P3306 -uroot -pPassw0rd -dzlm -tflash_table --start-file='/data/mysql/mysql3306/logs/mysql-bin.000004' --only-dml --sql-type delete --stop-never > flashback3.sql
Traceback (most recent call last):
File "binlog2sql.py", line , in <module>
back_interval=args.back_interval, only_dml=args.only_dml, sql_type=args.sql_type)
File "binlog2sql.py", line , in __init__
raise ValueError('parameter error: start_file %s not in mysql server' % self.start_file)
ValueError: parameter error: start_file /data/mysql/mysql3306/logs/mysql-bin. not in mysql server [root@zlm3 :: ~/binlog2sql/binlog2sql]
#ls -l /data/mysql/mysql3306/logs/mysql-bin.
-rw-r----- mysql mysql Jun : /data/mysql/mysql3306/logs/mysql-bin. --The binlog file is right there,it shows that it's no need to specify the absolute path in parameter "--start-file" [root@zlm3 :: ~/binlog2sql/binlog2sql]
#
- binlog2sql is coded by python,in order to use it you need to install python and relevant packages.
- some parameter such as "binlog_format=row","binlog_row_image=full" etc. in MySQL Server should be satisfied with.
- some privileges such as "super"/"replication client","replication slave" etc. in MySQL Server should be satisfied with too.
- it seems more inconvenient rather than the MyFlash tool does.
利用binlog2sql闪回丢失数据的更多相关文章
- 利用mysqlbinlog_flashback闪回丢失数据
today,i'll have a test with the open source tool mysqlbinlog_flashback which is released by ...
- 利用MyFlash闪回丢失数据(续)
last night,i've tested flashback by MyFlash tool,but failed,now let's do some other test with ...
- 利用MyFlash闪回丢失数据
MyFlash is an open source tool released by Meituan-Dianping which can be used to flashback MyS ...
- binlog2sql闪回恢复数据
用途: .数据快速回滚 .从binlog生成标准sql 使用限制: .必须设置binlog_format=ROW .binlog_row_image=full,该参数默认为FULL .恢复用户拥有的最 ...
- oracle_利用闪回功能恢复数据
方便起见一般:执行如下即可不用往下看: ① 启用行移动功能 alter table tbl_a enable row movement; ② 闪回表数据到某个时间点 flashback table t ...
- MySQL的binlog2sql闪回
从MySQL binlog解析出你要的SQL.根据不同选项,你可以得到原始SQL.回滚SQL.去除主键的INSERT SQL等. 用途=========== * 数据快速回滚(闪回)* 主从切换后新m ...
- MYSQL工具之binlog2sql闪回操作
文档结构: 在生产环境中如果遇到误删,改错数据的情况,利用mysql闪回工具binlog2sql,可以实现数据的快速回滚,从binlog中提取SQL,并能生成回滚SQL语句.Binlog以event作 ...
- Oracle 闪回 找回数据的实现方法
Oracle 闪回 找回数据的实现方法 闪回技术是Oracle强大数据库备份恢复机制的一部分,在数据库发生逻辑错误的时候,闪回技术能提供快速且最小损失的恢复.这篇文章主要介绍了Oracle 闪回 找回 ...
- binlog2sql闪回工具的使用
binlog2sql闪回工具的使用 一.下载安装依赖的python yum install openssl-devel bzip2-devel expat-devel gdbm-devel readl ...
随机推荐
- python全栈学习笔记(一)网络基础之网络协议篇
阅读目录 一.操作系统基础 二.网络通信原理 2.1 互联网的本质就是一系列的网络协议 2.2 osi七层协议 2.3 tcp/ip五层模型讲解 2.3.1 物理层 2.3.2 数据链路层 2.3.3 ...
- Python学习---模版/包的概念
1.1. 模块/包的概念 在Python中,一个.py文件就称之为一个模块(Module) 模块一共三种: python标准库 第三方模块 应用程序自定义模块 模块的使用:模块是用来组织函数的 解释器 ...
- DBMS_SQLTUNE使用方法
SQL调优工具包DBMS_SQLTUNE的使用方法 oracle 提供了优化建议功能包DBMS_SQLTUNE,该包可以帮助我们分析SQL,并提供优化建议. 原有执行计划alter session s ...
- 035server端并发聊天
import socketserver class MyServer(socketserver.BaseRequestHandler): def handle(self): # 里面是每个客户端连接执 ...
- Mutual Training for Wannafly Union #2
codeforces 298A. Snow Footprints 分类讨论三种情况: ①..RRRRRR… ②..LLLLLLL… ③..RRRLLLL.. //AC by lwq: #includ ...
- 阅读Hibernate框架Session接口的源码的笔记
一.阅读Session接口的注释的理解.(看着注释翻译的,有些地方可能翻译的不太对,有疑问再看源文档) ①.Session的生命周期随着事务开始而开始,事务的结束而结束. 附原文:The lifecy ...
- UVa 1626 - Brackets sequence(区间DP)
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- CF1063A Oh Those Palindromes
嘟嘟嘟 只要将每一种字母放一块输出就行了. 证明1:比如 1 2 3 4 5 6,那么这个序列对答案的贡献分别是1和5,2和4 ,3和6……如果重新排列成x x x x o o,会发现对 ...
- python 爬取猫眼下的榜单(一)--单个页面
#!/usr/bin/env python # -*- coding: utf- -*- # @Author: Dang Kai # @Date: -- :: # @Last Modified tim ...
- if __name__ == "__main__"如何正确理解
粗略来讲,__name__是当前模块,当模块被直接运行时模块名为__main__.这句话的意思是,当模块被直接执行时,代码将运行,当模块是被导入时,代码不被运行 例如,执行one.py # file ...