A thread-compatible interface to the popular MySQL database server that provides the Python database API.

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)

i am a newer in python.Today when I write some search function I met an error.well, I use sqlalchemy orm to do that, in my function,I input a chinese word as the key word.The html page give me an ...
1
vote
1answer
42 views

Can't append a list of dicts with dict from another list of dicts

Been Googling hours again for answer but seems like my situation is unique, or my understanding of Py is...uh, unique. I have a list of dictionaries (let's call it sqlListOfDict) built from ...
0
votes
1answer
17 views

Python MySQLdb query with variable and “time_format(time, '%H:%i')”

Been struggling for hours and having searched the Internet to no avail. I tried every suggestion from stackoverflow (use '%%', change the ',' before '(val)' to '%', bracket the '%s' with "'" etc) but ...
0
votes
0answers
22 views

Update rank in MySQL with WHERE clause

I'm trying to rank a MySQL table where ties share the same rank, I found the below code from question 2727138, does this, however I need a WHERE clause on playerID I've added it in a few places but ...
0
votes
0answers
24 views

MySQLdb undefined - import MySQLdb

So I have this application called Openfreezer. I have followed the instructions perfectly to make their web application work... and it does. But now when I play around with it and it starts calling ...
1
vote
4answers
46 views

MySQL select and update in one query

I'm trying to select a value from MySQL (total_points) then add to a local variable (new_points) and update total_points in the SAME query, does anyone know if this is possible... I currently have., ...
0
votes
1answer
40 views

Mysql-python can't connect to localhost server on Windows 7

i have a local mysql server running on localhost, Windows 7 C:\web>mysqld --console [...] 130428 19:12:37 [Note] mysqld: ready for connections. Version: '5.5.31-log' socket: '' port: 3306 MySQL ...
0
votes
1answer
19 views

Error “TypeError: not all arguments converted during string formatting” MySQLdb

I am trying to update a MySQL table through Python 2.7. I have read and tried many solutions and keep getting an error message: TypeError: not all arguments converted during string formatting import ...
0
votes
1answer
75 views

Python: Escape Single Quote from MySQL Query

I have a query string that runs in side a loop and for every item in the list query gets executed. The list contains strings and I use python string format technique to replace the query with the ...
1
vote
1answer
39 views

insert a Python list into a column in MySQL

I have list and I want to enter each element of that list into associated indexed cells of a column in MYSQL using Python. E.g lst = [11,22,33,44,55,66] MYSql column: Data 11 22 33 44 55 66. ...
0
votes
1answer
33 views

How do I remove a python egg?

This post (How to install MySQLdb (Python data access library to MySQL) on Mac OS X?) recommends cleaning up a MySQLdb installation by removing a python egg: "Step 3c: Remove the egg under ...
2
votes
1answer
36 views

Django - Can we make a connection to different remote database

I am writing a Django application where I already have 1 mysql backend db configured in my settings.py. I know we can add as many db configurations as we want, but that's hard coding which I don't ...
0
votes
1answer
40 views

Python: MySQL connection is open, but can't create cursor

I'm trying to open a cursor to a MySQL-DB. But I'm getting this error: 'NoneType' object has no attribute 'cursor' Here is a small sourcecode: class Sample: def __init__(self): self.conn = ...
0
votes
1answer
25 views

ON DUPLICATE KEY UPDATE with a WHERE and COUNT condition…?

I would have liked to use a WHERE statement on a ON DUPLICATE KEY UPDATE statement in MySQL, however I understand you can't do this. I wanted my statement to be something like this.. INSERT INTO ...
1
vote
1answer
37 views

Trouble building mysql-python on dotcloud: needs distribute >= 0.6.28

I'm suddenly having trouble building my Python/Django app on dotcloud. It seems that MySQL-python needs distribute >= 0.6.28. My requirements.txt specifies distribute==0.6.36, but this is being ...

1 2 3 4 5 41
15 30 50 per page