You can't. The mysqldb
adapter only supports the format
and pyformat
parameter styles.
The Python DB API 2.0 specification supports 5 different paramstyle
parameter styles but it is up to the exact database adapter implementation what they support. The mysqldb
project documentation tells you what styles are supported by that adapter, and qmark
is not one of them.
If you are trying to write SQL suitable for multiple database adapters, you'll most likely have to deal with more issues than just the parameter style. Consider using SQLAlchemy instead, which can generate SQL for you that is more database agnostic (up to a point).