A thread-compatible interface to the popular MySQL database server that provides the Python database API.
0
votes
0answers
18 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
28 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
...
0
votes
0answers
8 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
54 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
0answers
9 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
33 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
14 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 ...
0
votes
1answer
30 views
MySQLdb delete query - TypeError: not all arguments converted during string formatting
I'm trying to run a delete query using MySQLdb and passing 3 variables. The query is run as follows:
self.cursor.execute("""DELETE er.* FROM extension_recording er,
extension e, client c
WHERE ...
0
votes
0answers
40 views
Error installing MySQL-Python on Mac
I tried to install the MySQL-Python library for development with Django, but always show any errors in the different ways:
With PIP:
rigo:~ rigobcastro$ sudo pip install MySQL-Python
...
0
votes
0answers
10 views
Python Mysql plugin Installation - ImportError: dlopen [duplicate]
I Am having a problem when install MySQL for python. Using this tutorial
How to install MySQLdb (Python data access library to MySQL) on Mac OS X?
I am running OS 10.6.8
I get this error when I run
...
0
votes
1answer
40 views
variable not being defined in a class despite being defined in it's init function
from wx import *
import Customer as c
class CustomerMain ( wx.Frame ):
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Customers", pos = ...
0
votes
0answers
29 views
Cannot create cursor with MySQLdb
I am connecting to a database with the following code:
#generate connection to database
def connection():
return MySQLdb.connect(host = __HOST__,
user = __USER__,
...
0
votes
1answer
28 views
Running remote mysqldump over SSH all in python
Hi Im trying to write a Python script to SSH into a remote server and execute a mysqldump. My method so far was to establish portforwarding then run a backup script I already had written. I suspect ...