Escaping confusion with Python 3 + MySQL

Johann Spies johann.spies at gmail.com
Mon Mar 27 03:52:05 EDT 2017


Νίκος,

I am glad that you solved the problem.

I am not using mysql but postgresql.  When I get a problem using python to
communicate with the database, one of my first steps will be to determine
whether the error is a python (maybe psycopg-related) related error or a
database error.  What I do then is to use the string python is sending to
the database and try to run that on the commandline interface to the
database (psgl) or something like pgadmin3.  Mysql have similar tools.

Once you have determined that it a database related problem, it should be
easy to sort it out on that side.  If it works on the database the rest of
the problem should be solved on the python side.

Maybe this approach would have saved you some time.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


More information about the Python-list mailing list