- データベースを選択
- テーブルを作成
- テーブルのフィールドを参照
or
describe ;
- 挿入
- MySQL-pythonのインストール
- pythonからの参照
import MySQLdb
db = MySQLdb.connect(host="localhost", user="joe", passwd="secret", db="db56a")
cursor = db.cursor()
cursor.execute("SELECT * FROM animals")
result = cursor.fetchall()
for record in result:
print record[0] , "-->", record[1]
No comments:
Post a Comment