#!/usr/bin/python
import MySQLdb
con= MySQLdb.connect(host='localhost',user='root',passwd='123456',db='mysql');
cur=con.cursor();
cur.execute('show tables');
cur2=con.cursor();
data = cur.fetchall();
for i in range(0,len(data)):
a ="".join(data[i]);
cur.execute("select * from" + " "+ a);
print("table" + str(i) + " " + "is" + " " + a)
s = cur.fetchall();
for r in s:
print r;
cur.close();
con.commit();
con.close();