Posts

Showing posts with the label pymysql

How to ignore pymysql warnings?

How to ignore pymysql warnings? Consider this code: import pymysql db= pymysql.connect("localhost","root","","raspi") cursor = db.cursor() cursor.execute("INSERT INTO access(username)VALUES('hello')") db.commit() db.close() when I run it I'll get this error: C:Python36libsite-packagespymysqlcursors.py:165: Warning: (1364,"Field'salt' doesn't have a default value")result = self._query(query) How do I ignore pymysql warnings? Set a default value for salt , be it empty, null or banana . – Alex Karshin Jun 30 at 9:44 salt null banana 1 Answer 1 Reason why you're getting that error is because your salt field is not allowing NULL values but you're trying to insert the...