# coding: utf-8 import MySQLdb def main(): conn = MySQLdb.connect( user='testuser', passwd='testuser', host='192.168.33.3', db='testdb' ) c = conn.cursor() # テーブルの作成 sql = 'create table test (id int, content varchar(32))' c.execute(sql) print('* testテーブルを作成\n') # テーブル一覧の取得 sql = 'show tables' c.execute(sql) print('===== テーブル一覧 =====') print(c.fetchone()) # レコードの登録 sql = 'insert into test values (%