python – Inserting data into MySQL

My code currently doesn’t insert data into MySQL fast enough. However I don’t know how to measure the current speed.

def insert():
      mycursor = mydb.cursor()
      plik = input(":::")
      agefile = open("C:/Users/juczi/Desktop/New Folder/" + plik, "r")
      sql = "INSERT INTO wyciek (nick, ip) VALUES (%s, %s)"
      for row in agefile:
            mydb.commit()
            data = row.split(':')
            val = (data(0).replace("n",""), data(1).replace("n", ""))
            mycursor.execute(sql, val)
      agefile.close()