import os
import pymysql
conn = pymysql.connect(
    host=os.environ['MYSQL_HOST'],
    user=os.environ['MYSQL_USERNAME'],
    password=os.environ['MYSQL_PASSWORD'],
    database='plwiki_p',
    charset='utf8'
)
with conn.cursor() as cur:
    cur.execute('use plwiki_p')
    cur.execute("""select count(linter_cat) from linter where linter_cat=4;""")
    wyniki = cur.fetchall()
    print(wyniki)
((140837,),)
  with conn.cursor() as cur:
    cur.execute('use plwiki_p')
    cur.execute("""describe linter""")
    wyniki = cur.fetchall()
    print(wyniki)
(('linter_id', 'int(10) unsigned', 'NO', '', '0', ''), ('linter_page', 'int(10) unsigned', 'NO', '', None, ''), ('linter_cat', 'int(10) unsigned', 'NO', '', None, ''), ('linter_start', 'int(10) unsigned', 'NO', '', None, ''), ('linter_end', 'int(10) unsigned', 'NO', '', None, ''), ('linter_params', 'blob', 'NO', '', None, ''))
with conn.cursor() as cur:
    cur.execute('use plwiki_p')
    cur.execute("""select * from linter limit 10;""")
    wyniki = cur.fetchall()
    print(wyniki)
((52742, 3662615, 2, 0, 5703, b'{"name":"center"}'), (52743, 3662615, 2, 47, 71, b'{"name":"center"}'), (52744, 3662615, 2, 73, 113, b'{"name":"center"}'), (52745, 3662615, 2, 115, 156, b'{"name":"center"}'), (52746, 3662615, 2, 158, 185, b'{"name":"center"}'), (52747, 3662615, 2, 187, 208, b'{"name":"center"}'), (52748, 3662615, 2, 213, 245, b'{"name":"center"}'), (52749, 3662615, 2, 247, 305, b'{"name":"center"}'), (52750, 3662615, 2, 307, 328, b'{"name":"center"}'), (52751, 3662615, 2, 330, 353, b'{"name":"center"}'))