mysql or 查詢,python查詢數據庫最快的庫?
#!/usr/bin/python import MySQLdb # 打開數據庫連接 db = MySQLdb.connect("localhost","testuser","test123","TESTDB" ) #打開游標 cursor = db.cursor() # 執行數據庫查詢 cursor.execute("SELECT * from users") # 獲取結果集的第一行 data = cursor.fetchone() print "Database version : %s " % data # 關閉連接 db.close()