2013年4月19日
摘要: import MySQLdbconn = MySQLdb.connect(host="localhost", \user="root", \passwd="root", \db="TestDB")cursor = conn.cursor()cursor.execute("select * from Users")res = cursor.fetchall()print rescursor.close()conn.close() 阅读全文
posted @ 2013-04-19 19:52 andy071001 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 查看CPU信息(型号)# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 8 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz(看到有8个逻辑CPU, 也知道了CPU型号)# cat /proc/cpuinfo | grep physical | uniq -c 4 physical id : 0 4 physical id : 1(说明实际上是两颗4核的CPU)PS:Jay added on 10th, May, 2011# 其实是可能有超线程HT技术,不一定是有4核,也可能是2核4线程;当时... 阅读全文
posted @ 2013-04-19 10:47 andy071001 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 多人开发时需要在配置文件中加入自己的配置数据库信息,最好不要把自己的数据库密码放入其中,因此可以把本机数据库密码设为空 mysql>use mysqlmysql>update user set password=password('') where user='username';mysql>exit~>mysqladmin -uusername -p -h192.168.1.40 reload注意重载权限表的时候用以前的密码而不是用空密码 阅读全文
posted @ 2013-04-19 10:36 andy071001 阅读(1585) 评论(0) 推荐(0) 编辑