Code:
def on_button1_clicked(self, widget, data=None):
        con = MySQLdb.connect('localhost', 'root', 'warriors', 'reg');
        with con:
            cur = con.cursor()
            sql_st="INSERT INTO regg (username, password) VALUES ('ra','%s')"
            cur.execute(sql_st)
            print "It has been inserted successfully "



here the values...