When using mysqldb and cursor.execute()
, pass the value None
, not "NULL"
:
value = None
cursor.execute("INSERT INTO table (`column1`) VALUES (%s)", (value,))
Found the answer here
More Related Contents:
- mysql to pdf – python or ruby [closed]
- How to insert a space delimited text file into mysql using Python? [closed]
- Installing specific package version with pip
- How can I connect to MySQL in Python 3 on Windows?
- Python & MySql: Unicode and Encoding
- Authentication plugin ‘caching_sha2_password’ is not supported
- How to disable SQLAlchemy caching?
- Setting Django up to use MySQL
- memory-efficient built-in SqlAlchemy iterator/generator?
- How can I insert data into a MySQL database?
- How to use MySQLdb with Python and Django in OSX 10.6?
- When to close cursors using MySQLdb
- How to enable MySQL client auto re-connect with MySQLdb?
- How to build a flask application around an already existing database?
- Python MySql Insert not working
- What is the best solution for database connection pooling in python?
- Python: MySQLdb and “Library not loaded: libmysqlclient.16.dylib”
- How to filter (or replace) unicode characters that would take more than 3 bytes in UTF-8?
- trapping a MySql warning
- ImportError: No module named ‘MySQL’
- Simple Subquery with OuterRef
- Python JSON encoder to support datetime?
- Reverse engineer SQLAlchemy declarative class definition from existing MySQL database?
- Print results in MySQL format with Python
- Python’s MySqlDB not getting updated row
- Django + MySQL on Mac OS 10.6.2 Snow Leopard
- Imploding a list for use in a Python MySQL IN clause
- Single Django model, multiple tables?
- flask-login: can’t understand how it works
- How to disable query cache with mysql.connector