import dataset db = dataset.connect('mysql://johnny:pAsJohnny_2022@db.ptt.cx:3306/google_poi?charset=utf8mb4') cursor=db.query('SELECT count(*) as cnt FROM google_poi.shop_list3') for c in cursor: print(c['cnt'])