Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

python mysqlµ¼ÈëÊý¾Ý

[root@pku-fan MySQL]# cat limbs.sql
CREATE DATABASE cookbook;
USE cookbook;
DROP TABLE IF EXISTS limbs;
CREATE TABLE limbs
(
    thing   VARCHAR(20),    # what the thing is
    legs    INT,            # number of legs it has
    arms    INT             # number of arms it has
);
INSERT INTO limbs (thing,legs,arms) VALUES('human',2,2);
INSERT INTO limbs (thing,legs,arms) VALUES('insect',6,0);
INSERT INTO limbs (thing,legs,arms) VALUES('squid',0,10);
INSERT INTO limbs (thing,legs,arms) VALUES('octopus',0,8);
INSERT INTO limbs (thing,legs,arms) VALUES('fish',0,0);
INSERT INTO limbs (thing,legs,arms) VALUES('centipede',100,0);
INSERT INTO limbs (thing,legs,arms) VALUES('table',4,0);
INSERT INTO limbs (thing,legs,arms) VALUES('armchair',4,2);
INSERT INTO limbs (thing,legs,arms) VALUES('phonograph',0,1);
INSERT INTO limbs (thing,legs,arms) VALUES('tripod',3,0);
INSERT INTO limbs (thing,legs,arms) VALUES('Peg Leg Pete',1,2);
INSERT INTO limbs (thing,legs,arms) VALUES('space alien',NULL,NULL);
[root@pku-fan MySQL]#mysql -u root -p < limbs.sql
±à¼­python³ÌÐò
import MySQLdb
db_user = '²»ÄÜ˵'
db_pw   = 'ÃØÃÜ'
db = MySQLdb.connect('localhost', db_user, db_pw, 'cookbook')
c = db.cursor()
c.execute("select * from limbs")
print "%17s\t%7s\t%7s" % ('thing','legs','arms')
for thing,legs,arms in c.fetchall():
        print "%17s\t%7s\t%7s" %(thing,legs,arms)


Ïà¹ØÎĵµ£º

¸ßЧµÄMySQL·ÖÒ³

PERCONA PERFORMANCE CONFERENCE 2009ÉÏ£¬À´×ÔÑÅ»¢µÄ¼¸Î»¹¤³Ìʦ´øÀ´ÁËһƪ”Efficient Pagination Using MySQL“µÄ±¨¸æ£¬ÓкܶàÁÁµã£¬±¾ÎÄÊÇÔÚÔ­ÎÄ»ù´¡ÉϵĽøÒ»²½ÑÓÉì¡£
Ê×ÏÈ¿´Ò»Ï·ÖÒ³µÄ»ù±¾Ô­Àí£º
mysql> explain SELECT * from message ORDER BY id DESC LIMIT 10000, 20\G
***************** 1. row ** ......

×Ô¶¯½âѹ´óÁ¿Ñ¹ËõÎļþ Python ½Å±¾

֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£Ô­ÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......

python±àÂëÎÊÌâºÍi18n

ת×Ô http://www.javaeye.com/topic/66558
³õѧPython,Óöµ½ºÜ¶à±àÂëÎÊÌ⣬¼ÇÏÂÀ´ÒÔÃ⽫À´ÓÖÍüÁË£¬ºÜ¶à¶«Î÷²»¶®£¬¶¼ÊÇÊôÓÚ²»ÇóÉõ½â£¬ÂÒϽáÂÛ£¬µ«Ïëµ½ÄóöÀ´¿ÉÒÔÓÐÈÈÐÄͬѧָ³ö´íÎóËùÔÚ£¬±ãºñÆðÁ³Æ¤ÁË……
Ê×ÏÈÐèÒªÁ˽âPythonÖÐÓÐÁ½ÖÖ×Ö·û´®(ÑϸñµØ˵,Ëƺõ²»ÄÜÕâô½Ð)¡£Ò»ÖÖÊÇÆÕͨµÄstr¶ÔÏó£¨Ã¿¸ö×Ö·ûÓÃ8bits± ......

Mysql³õʼ»¯rootÃÜÂëºÍÔÊÐíÔ¶³Ì·ÃÎÊ

Mysql³õʼ»¯rootÃÜÂëºÍÔÊÐíÔ¶³Ì·ÃÎÊ
mysqlĬÈÏrootÓû§Ã»ÓÐÃÜÂ룬ÊäÈëmysql –u root ½øÈëmysql
1¡¢³õʼ»¯rootÃÜÂë
½øÈëmysqlÊý¾Ý¿â
1
mysql>update user set password=PASSWORD(‘123456’) where User='root';
2¡¢ÔÊÐímysqlÔ¶³Ì·ÃÎÊ,¿ÉÒÔʹÓÃÒÔÏÂÈýÖÖ·½Ê½:
a¡¢¸Ä±í¡£
1
mysql -u root – ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ