Tagged Questions
0
votes
1answer
20 views
django and mysql setup in production
I'm trying to setup mysql on my production server(Ubuntu 12.04). I followed this tutorial http://www.saltycrane.com/blog/2008/07/how-set-django-mysql-ubuntu-hardy/ Then I run python manage.py syncdb ...
0
votes
0answers
5 views
MySQLdb - libmysqlclient_r stuck on read()
I am writing a multi-threaded python application that read/write to a MySQL DB (using MySQLDB and libmysqlclient_r - thread safe library).
At some point (not sure why or when), one of the threads ...
0
votes
1answer
26 views
Python mysqldb returns inserted row but mysql returns an emptyset
I use mysqldb to insert a row:
def insertNewLog(self,uid,beginDate,endDate,logs):
qry1 = """INSERT INTO logs (owner,createDate,endDate,log) VALUES (%s,%s,%s,%s); """
cursor = ...
0
votes
1answer
23 views
Internationalization - Python MySQLDb and ISO-8859-7
I have written a python script to parse an HTML page, get some strings and then write to a mysql table. I am using the MySQLDb module for the database connection.
The strings retrieved are encoded ...
0
votes
1answer
21 views
PyMySQL error/exception on (file) data load to remote MySQL instance
I am using PyMySQL-0.5.0 and facing an obscure'ish error/exception when loading data from a file to a remote MySQL instance. Upon executing a 'load data local infile ...' statement, I am seeing an ...
0
votes
2answers
28 views
Escaping MySQL reserved words with Python dbapi
I am looking for a nice "pythonic" and "SQL-Injection-free" solution for a problem with reserved words in MySQL.
I have the following code:
alter_sql = 'ALTER TABLE %s ADD COLUMN %s TEXT'
...
0
votes
0answers
32 views
Writing MySQL databases in Python using mySQLdb
So I have the following code, and it works:
for count in range(0,1000):
L=[random.randint(0, 127),random.randint(0, 127),random.randint(0, 127)]
random.randint(0, 127)
...
0
votes
0answers
60 views
Execute .sql file in Python with MySQLdb
I have a .sql file containing a bunch of SQL queries, with each query spanning multiple lines. I want to execute these queries in MySQL via Python using MySQLdb.
sqlite3 has "a nonstandard shortcut" ...
0
votes
2answers
52 views
Does a commit on a Python MySQLdb cursor affect transactions in progress in another cursor?
If I have multiple cursors (each in a different thread, for example) generated from the same DB connection, does a commit on one cursor (e.g. in Python: cursor.execute('COMMIT')) affect transactions ...
0
votes
1answer
46 views
Grouping SQL queries
Sometimes an application requires quite a few SQL queries before it can do anything useful. I was wondering if there is a way to send those as a batch to the database, to avoid the overhead of going ...
0
votes
1answer
25 views
Connect to Database via proxy a python script
I have a python script that connects to a remote MySQL database using the python library MySQLdb. It works fine but how can I get it to connect through a proxy that I'm behind when at work. I can ...
0
votes
2answers
62 views
MySQLdb connection error with localhost with different port (eg. 8080)
I am trying to connect MySQLdb to MySQL. It was working fine when when my server was localhost and port 80. But due to some reason I had to change the port to 8080. Now how do I specify the port in ...
0
votes
1answer
43 views
Python MySQLdb insert issue
there I am writting a simple app in Python that will monitor the usage of my cpu and ram and put it into a MySQL database for future processing here is my code :
import MySQLdb
import psutil
...
0
votes
3answers
49 views
MySQL and Python charset error
I am currently working on formatting data between CSV files and an mySQL database. I am using the MySQLdb library to manage the connection, but it seems to be some problems with formatting. I have to ...
0
votes
1answer
25 views
MySQLdb Results
I want to be able to get all the information from MySQLdb using the SELECT * FROM query. I have the following code:
database = MySQLdb.connect("127.0.0.1", "root", "pswd", "Kazzah")
...