py_innodb_page_info.py

这段时间在看《mysql技术内幕 innodb存储引擎》一看到作者用Python写了个py_innodb_page_info.py的工具,所有到googl去找,但是没有找到,于是就看到有个哥们弄到了,所有自己就把他的贴过来了,以后自己好查看。下面是地址:
http: //david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/,
在此感谢那位热心网友。
接下来进入正题
下载 py_innodb_page_info.py
#wget http: //david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/py_innodb_page_info.py
运行
# python /root/py_innodb_page_info.py /data/mysql/ibdata1
Traceback (most recent call last):
File  "/root/py_innodb_page_info.py" , line  3 in  <module>
import  mylib
ImportError: No module named mylib
提示缺少mylib,其实整个py_innodb_page_info.py要完整运行的话,需要三个.py脚本
1 . include .py
2 .mylib.py
3 .py_innodb_page_info.py
注意:需要将三个脚本放在同一目录下
wget http: //david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/mylib.py
wget http: //david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/include.py
测试下是否成功

[root@yang mysql]# python  py_innodb_page_info.py /mydata/data/ibdata1 

Total number of page: 1152:

Insert Buffer Bitmap: 1

System Page: 236

Transaction system Page: 2

Freshly Allocated Page: 785

Undo Log Page: 83

File Segment inode: 7

B-tree Node: 37

File Space Header: 1


你可能感兴趣的:(mysql,技术,python,recent,googl)