mysqlclient can't select rows which are inserted after MySQLdb.connect()

158
March 22, 2018, at 10:56 AM

I have something weird in mysqlclient v1.3.10 (python 3).

Say I create a database connection db = MySQLdb.connect(host='localhost', user='root', passwd='', db='test'), then I insert a new row using Sequel Pro. If I select the new row using cursor = db.cursor(); cursor.execute('''select ...'''), it returns nothing.

I found doing db.commit() could fix the problem. Is it safe to do so, because I only want to perform select in this script? Will commit() do anything to the database, even without insert or update queries before it? What would be the appropriate way to accomplish this problem? Thanks.

Rent Charter Buses Company
READ ALSO
JavaFX application features not working when exporting to Executable Jar file

JavaFX application features not working when exporting to Executable Jar file

I have created a JavaFX application using to connect to a MySQL db using JDBCEverything works perfect in eclipse, I am able to connect to my db using JDBC and perform insert update and select query's when I run my project in Eclipse

126
Search All Fields In All Tables For A Specific Value (Oracle)

Search All Fields In All Tables For A Specific Value (Oracle)

Is it possible to search every field of every table for a particular value in Oracle?

173
Query for daily amount outstanding on all active loans

Query for daily amount outstanding on all active loans

Suppose i have a single table that contains a history of loans made to clients with the columns:

125