I did everything through Python 3.5 in conjunction with PyMySQL. The table seems to be created, everything works. MySQL server is held locally. PHP works great with it, but Python doesn't want to add data. Code:

# Предположим что login = 'Test', а passw = 'Coffee' con = sql.connect(db='testdb', user='root', passwd='', host='127.0.0.1') cur = con.cursor() query = "INSERT INTO test VALUES('{}','{}');".format(login,passw) cur.execute(query) con.close() 

Tell me, what could be the error? Or is it somewhere on the side of MySQL?

    1 answer 1

    Didn't work with PyMySQL, but I suppose it works just like psycopg2 (PostgreSQL driver). You are missing a string

     conn.commit() 

    She must go after

     cur.execute(query) 
    • Thank you very much! It works now! - Dj_Haski