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

learn more… | top users | synonyms (1)

3
votes
0answers
159 views

Why does SIGINT sent to Python script kill MySQL connection?

I'm having an issue with sending SIGINT's to python scripts which are connecting to a MySQL database using MySQLdb (mysql-python). The python script runs in an infinite loop, and I want to catch the ...
2
votes
0answers
276 views

Python MySQL connection randomly lost

I have the following problem: I am using Python with MySQLdb and a SSDictCursor to iterate over a pretty large database (250M lines). Because I am unable to load everything into RAM, I am using the ...
2
votes
0answers
715 views

Python MySQLdb - Programming Around SQL Injection Code

First, i'm very new to stack overflow (first question posted) and forums in general. In addition to this downfall, I'm also new to development and databases other than at a Systems Administration type ...
2
votes
0answers
662 views

Python MySQLdb connection - when to open/close new connections?

I'm using a few apps running Tornado Web server which all connect to a MySql DB using mysqldb. When I spin up the server, it instantiates a DB class (below) which opens a connection to the DB. All ...
2
votes
0answers
156 views

MySql child processes are consuming a lot RAM space

I have a problem with RAM consumption on my server. Where at certain hour of day RAM usage increases to critical limit. To check the issue I tried to run htop command and found that most of the RAM ...
2
votes
0answers
224 views

Copy unicode data from MSSql to MySql in Python error

I am trying to copy unicode data from MSSql to MySql. Below is the code that I am trying for past few days, but unable to do it successfully. #!/usr/bin/python # -*- coding: utf-8 -*- import MySQLdb ...
2
votes
0answers
164 views

How to connect MAMP based MYSQL in Python?

I recently upgraded Python on my Macbook to 2.7 via Macport and eventually I had to upgrade MySQL driver too. I tried to install it via Macport but that guy installed another copy of MySQL server too. ...
2
votes
0answers
635 views

Python - SSH Tunnel Setup and MySQL DB Access

I am trying to connect to my server from my local(windows) and access the MySQL DB With the below code setting up the SSH tunnel through putty, I am not able to access the MySQL DB. con = None con ...
1
vote
0answers
23 views

Python MySQLdb not refreshing database information

I'm currently codiing a simple IRC moderator/utility bot. I plan to have a web interface that will easily update command data and whether or not the command is enable using a MySQL database to store ...
1
vote
0answers
15 views

Query via Python's MySQLdb library works fine locally but not on Elastic Beanstalk

As the title indicates, I have a simple query that works fine locally but is causing an internal service error when executed on EB. The code is super simple: #Connect to the database db = ...
1
vote
0answers
28 views

String substitution using cursor.execute of mysql.connector

I am using mysql.connector to execute some simple SQL statements. In this example I am creating a database schema. I want to pass the database as a variable and use substitution in the SQL. I believe ...
1
vote
0answers
20 views

Is it possible to customize errorhandler in mysql-python? (using peewee)

I am writing a mibbleware around mysql-python. The aim is to wrap all mysql errors to my own handler instead of throwing an exceptiong and break the logic. My middleware is using peewee like this ...
1
vote
0answers
83 views

'MySQL server has gone away' on Django 1.6.5

I am running Django 1.6.5 with mysql (5.6.17). Have the following DB settings in Django: DATABASES = { 'default': { 'ENGINE' : 'django.db.backends.mysql', 'NAME' : ...
1
vote
0answers
34 views

how to implement a flask sqlalchemy query using a query that is passed into a function

I'm trying to convert this mysql query into flask sqlalchemy: SELECT * FROM (*results query*) AS someDocuments WHERE agency in (SELECT agency FROM document WHERE agency ='Comptroller'); i'm ...
1
vote
0answers
55 views

How to share a single MySQL database connection between multiple processes in Python

How can I create a single database connection and have each process talk to it, to minimize the overhead of spawning a new connection with each iteration? Here's some sample code to illustrate what ...
1
vote
0answers
31 views

MySQLdb Python Update Matched row versus Changed rows

From the mysql client command line, I get useful information after an UPDATE telling me both how many rows were matched by the WHERE clause, and how many were actually changed. In the case where I'm ...
1
vote
0answers
36 views

How to use MySQLdb with unicode username, password, database?

I am trying to us MySQLdb to connect to my MySQL database. Everything works as expected when I use a valid mysql user name like "fred", but fails when I try to use a valid mysql unicode user name, ...
1
vote
0answers
170 views

MySQL-python installation error using pip2.7

I have installed Python2.7,virtualenv and pip2.7 in centos6.4 64bit as python2.6 is a default one. when i try to install mysqldb using pip2.7 install MySQL-python error occurs and python-devel ...
1
vote
0answers
258 views

ResourceClosedError with mysql, sqlalchemy and celery

I am using sqlalchemy in an app where celery tasks use a scoped session to interact with mysql. db.py engine = create_engine( 'mysql://root:pass@localhost/testdb?charset=utf8&use_unicode=0', ...
1
vote
0answers
88 views

Mysql join query works in Mysql Workbench, but hangs at PyDev

I have been trying to run this query in PyDev environment for a while, but it just hangs there. The tables involved are large (tweets around 700,000 and user about 400,000). I have all the indexes ...
1
vote
0answers
53 views

Make database I/O reliable in multithreaded program

First, my apologies for posting this entire block of code. I think it's important to be able to answer my (broad) question. I have this application. It collects data (eventually from an external ...
1
vote
0answers
169 views

Unable to Insert into database

I want to insert data into the database using following script.There can be 3 suppliers and with respect to each of them I need to store the Warehouse state and zip code . import MySQLdb as mdb ...
1
vote
0answers
101 views

Synchronization of Intellij/PyCharm with installed python modules

I do not understand how Intellij "finds" the installed python modules. Here is an example: I have installed the python mysqldev sudo apt-get install python-mysqldb It is working on command line ...
1
vote
0answers
173 views

How to print standard/native MySQL output on the screen?

As per the title say: Is there a way to print standard/native MySQL output on the screen? I'm talking about, e.g. something like this: san@pcjq:~$ mysql -uroot -p mysql -t -e "SELECT Host,User FROM ...
1
vote
0answers
103 views

ImportError: No localization support for language 'eng' in python

i am getting ImportError: No localization support for language 'eng' when using MySQL Connector Python. My Traceback is as below. Traceback (most recent call last): File \"DB_Module.py\", line 151, ...
1
vote
0answers
494 views

Twitter API getting follower ids for huge number, without getting error

[I am using Python, and ruby gem twurl to request with OAuth.] I am trying to get follower ids from Twitter, for @BarackObama, who has 24,265,751 followers currently. Mathematically, 24,265,751 ...
1
vote
0answers
171 views

install MySQLdb to run in Pydev on Mac OS X 10.8

I had been stuck in some incompatible conflicts while trying to install mysql-python in Mac OS X 10.8 for a few days. After looking at some forums I found the solution to force Python run in 32 bit ...
1
vote
0answers
314 views

Improve multithreading with network IO and database queries

I'm writing a script that: fetch a list of urls from a db (about 10000 urls) download all the pages and insert them into the db parse the code if(some condition) do other inserts into the db I ...
1
vote
0answers
680 views

WSGI: _mysql.so Image not found

Environment: MacBook Pro, OSX 10.6, Python 2.6.1 64 bit, MySQL 5.X 64 bit I am having problems installing MySQLdb for use with Django. After installing everything I am able to open the python ...
0
votes
0answers
16 views

Installating python on centos

I have installed python2.7 on centos by following tutorial http://bicofino.io/blog/2014/01/16/installing-python-2-dot-7-6-on-centos-6-dot-5/, now i am having two version of python in at my centos5, ...
0
votes
0answers
12 views

error “No module named MySQLdb”

After importing the module, on script run I get the error and I have the module installed already, I am new with python, so I expect I might have forgot to install something else? Python is version ...
0
votes
0answers
15 views

Django forcing UTF-8 on misconfigured MySQL Server

I am using the MySQL-Python driver v1.2.5 with Python 2.7.x and Django 1.5.x. I have a situation where I require a Django application to work entirely in UTF-8, yet the production MySQL server is ...
0
votes
0answers
24 views

How to Escape special characters during insertion in python-mysql?

I am scraping some data-points from a webpage using python and storing it into list. Now i want to store this list into different columns of the table. The data i am pulling is having some special ...
0
votes
0answers
30 views

Python import MySQLdb error

I'm having trouble importing MySQLdb to python. I'm using python 2.7 in Mavericks. I followed this helpful post (and links therein) to install, and it all looked good up until the end. But I am ...
0
votes
0answers
15 views

Python Index Error

Ok. I'm stuck Any help would be appreciated. I'll start by saying I'm just trying to learn some Python, so hopefully this will be obvious. I'm trying to pull a value out of a database, parse the "-" ...
0
votes
0answers
44 views

Compiling mysql-python on Windows with PIP

So I have Python 2.7 and setuptools installed on my Windows 7 laptop. I also have Visual Studio 2008 Express installed and MySQL with dev tools. I am trying to install mysql-python via pip like: pip ...
0
votes
0answers
42 views

How can this be: mysql-python inside virtualenv IS installed, still “ImportError: No module named MySQLdb”

I've been hanging around here for a couple of years but have never really had reason to post something before, because there's already so many awesome threads here. However, now I've hit the first ...
0
votes
0answers
10 views

Python / Mysql / paramaterized query update

So annoyed: I'm lost, over something very trivial. cursor = db.cursor() cursor.execute("UPDATE Users SET bio_rake = %s WHERE id = %s", (keywords, id)) Error: Error 1241: Operand should ...
0
votes
0answers
5 views

Does MySQLdb module has some restrictions on passwd when connectting Mysql database?

At first, I use sqlalchemy module to connect mysql, and it worked fine when my mysql database's password's length for root is 17.However, after I changing to use mysqldb module to connect mysql ...
0
votes
0answers
124 views

Installing MySQLdb specifically in python 2.7 on centos

I'm using CentOS release 6.5 (Final). I 'm currently using python 2.4, in which I can use MySQL without problems. root@dedicado [/home/digicelc/public_html/gestion/python/cater]# python ...
0
votes
0answers
358 views

MySQLdb Python Installation

im trying to connect my MAMP MySQL in Python i have followed steps from here and successfully installed it https://gist.github.com/zeuxisoo/917222 but when i try to import _mysql and run this ...
0
votes
0answers
26 views

Python mySQLdb and \X91 chars introduced in table name

I am new to the mySQLdb package in Python2.7 I got an error in Python when trying to insert some data in a SQL database: File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line ...
0
votes
0answers
72 views

MySQL 5.6.17 is conflicting with python-mysql configuration

I am trying to setup a web application on EC2. After I followed this tutorial: http://opensourcedbms.com/dbms/install-mysql-5-6-ubuntu-13-10-x64-debian-linux/ and successfully installed MySQL 5.6.17 ...
0
votes
0answers
25 views

TypeErrors ValueErrors while passing an appended array in Flask-jsonify

I hope my title describes my question to the point (1st post) I've looked at several examples on how output the result from a MySQL query to JSON while using Flask, and I came across the jsonify ...
0
votes
0answers
71 views

How to link 2 ComboBoxs with Pmw & Tkinter and call back add, remove buttons functions from Mysql database

![This my GUI interface] I am giving code also, my problem is that i unable to remove widgets(entire row) and how to count selected number of layers when i press add button and link with state ...
0
votes
0answers
130 views

NoneType object has no attribute cursor

I am calling below 2 lines in a loop so thousands of connections are open at a given time. Sometimes this code raises an exception saying 'NoneType' object has no attribute cursor. Why is this thing ...
0
votes
0answers
7 views

MySQLdb truncation behavior inconsistent (with MySQL in 'TRADITIONAL' mode)

I set my MySQL to operate in 'TRADITIONAL' mode (modified my.cnf) - to avoid skipping over data truncation (so called "warnings"). I thought it worked fine. For example, if I tried to insert say ...
0
votes
0answers
54 views

MySQLdb import fails in terminal but works in eclipse

I tried to install MySQLdb using easy_install as well as PIP. It says it installed fine. When I try to run a script from the terminal it says Traceback (most recent call last): File ...
0
votes
0answers
81 views

Connect to external database (mysql) with python

I am trying to connect to my website's MySQL database from my own computer. The script I use: hostaddress = 'sitedezign.net' username = '*********' password = '*********' database = '*********' ...
0
votes
0answers
116 views

DLL error creating first Django app

I'm getting a strange error when I try 'python manage.py runserver' (env) C:\django\new_project\mysite>python manage.py runserver Traceback (most recent call last): File "manage.py", line 8, in ...