A thread-compatible interface to the popular MySQL database server that provides the Python database API.
0
votes
1answer
17 views
Python-MySQLdb: Difficulty In Creating Table
I am facing a problem while creating a table in mysqldb using python like this:
cursor.execute("CREATE TABLE IF NOT EXISTS %s ( tweetId VARCHAR(100) NOT NULL, tweet VARCHAR(180) NOT NULL, PRIMARY ...
0
votes
0answers
5 views
Issue with gcc-4.0 while installing mysql-python on Mountain Lion
I'm trying to install mysql-python, but running into several problems. If I just type:
$easy_install mysql-python
then I get:
EnvironmentError: mysql_config not found
I believe I've fixed this ...
1
vote
2answers
21 views
How to fetch top n records for each category [duplicate]
I have a table like below, placed at SQL FIDDLE
id empid proj file rating
~~ ~~~~~ ~~~~ ~~~~ ~~~~~~
1 1863 G1 file1 1
2 P4645 G1 file2 1
3 P6682 G1 file3 1
4 P6682 ...
0
votes
1answer
28 views
How to use other table field in SQL Where clause
I have a scenario were i need to select the rows from one table provided the the condition satisfies in other table.
Sorry if i am confusing....
I am using MySQL as database with python 2.6 to ...
0
votes
1answer
20 views
Is it wise to store a list of objects as a variable in another object?
So lets say I have an order which lists multiple items and some attributes like their ID and prices.... My original concept involved treating these objects separately and having the items listed in ...
0
votes
2answers
33 views
Insert datetime.datetime object in MySQL
I'm trying to insert my datettime object into MySQL
>>> t
datetime.datetime(2013, 5, 21, 19, 33, 36, tzinfo=tzutc())
>>> cursor.execute('INSERT INTO tweets(created_at) VALUES ...
0
votes
0answers
35 views
Why do I get these errors “Data truncated for column”?
I use this string to upload my CSV file into a MySQL table.
Query = """ LOAD DATA LOCAL INFILE 'Data to file_name.csv' INTO TABLE table_name
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ...
0
votes
2answers
39 views
Using a Python variable in MySQL query
I am trying to write a function that takes the variable written in the function placeholder() written below and then uses that in MySQL queries. I have written up an example below:
import MySQLdb
...
1
vote
1answer
23 views
How to get MySQLdb running on Mountain Lion with Python 2.7 and MySQL 5.6.11 x86_64
I have gone through various possibities of installing MySQL following hundreds of advice (e.g. here on stackoverflow) in order to get MySQLdb running. After having installed Xcode and Command Line ...
1
vote
2answers
58 views
How can one optimize this MySQL count algorithm?
I have 2 tables; one is users and the other records user actions. I want to count the number of actions per user and record this in the users table. There are ~100k user and the following code takes 6 ...
0
votes
1answer
18 views
Getting peewee to work on elastic beanstalk
I'm trying to install the peewee package on an elastic beanstalk instance to control a bottle application. I think the problem is with the MySQL-python dependency, but peewee doesn't load either. My ...
0
votes
1answer
34 views
Python 2.6 : How to pass variable to mysql query if it must be placed above application(environ?
The only way to get a variable from the URL is via
under the
def application(environ, start_response):
but the mysql code must be placed on top of this line.
what are the known options ?
extra ...
0
votes
0answers
19 views
Python MySQLdb returns a list of empty strings on a large query
The MySQL query I'm running returns 2,903,781 items in its result set.
When I do the query using MySQLdb in Python, and attempt to get back a list with fetchall(), I get a list that is the correct ...
0
votes
1answer
28 views
using the GetIndex() function
Managed to fix up my code. now thing is I'm trying to call up an event to use the getIndex() to extract the index of the currently selected listctrl item. I know I need to pass a varable for event but ...
1
vote
1answer
47 views
Why does this table name require back-ticks?
I am seeing a curious name dependency in the following MySQL table definition. When I code the table as shown, it seems to break MySQL. When I perform "select * from dictionary_pair_join" from ...