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 ...
1
vote
1answer
240 views
Insert a lot of products opencart script
I have a script in python in which I have all my products, descriptions , images, etc. Now I want to insert all this information in my Opencart theme. I try to find out how to save it all of this in ...
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
0answers
19 views
python MySQLdb error
I'm getting this error when running the script at http://pastebin.com/QhsznmYr
*Content-Type: text/html
Traceback (most recent call last):
File "out.py", line 14, in <module>
...
1
vote
2answers
2k views
Trouble Setting Up MySQLdb Module
I'm pulling my hair out over here trying to set up MySQLdb on my Mac in order to connect to a remote MySQL server.
I have installed the latest C MySQL client libraries
I have installed XCode 4
I ...
2
votes
1answer
21 views
exception thrown by query through Mysqldb in python. It is being executed at mySQL directly
I am try to calling a function to execute a query:
def run(self,query):
try:
self.cursor = self.conn.cursor ()
self.cursor.execute(query)
except ...
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
27 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
31 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" ...
1
vote
1answer
23 views
Problems with execute parameters type in MySQLdb
This code:
c.execute("UPDATE Players SET %s = %d WHERE nick=%s", (parts[1], int(parts[2]), parts[0]))
Is giving me this error:
TypeError: %d format: a number is required, not str
I know execute ...
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 ...
2
votes
2answers
70 views
Python encoding for swedish charachters
I'm using scrapy to extract data from a web site. I'm saving the data to a mysql database using MysqlDB. The script works for english sites, but when I try it on a swedish site i get:
...
8
votes
4answers
3k views
mysql_config not found when installing mysqldb python interface
I am trying to get a Python script to run on the linux server I'm connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to install mySQLdb via ...