A thread-compatible interface to the popular MySQL database server that provides the Python database API.
3
votes
0answers
154 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
259 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
634 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
619 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
150 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
215 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
158 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. ...
1
vote
0answers
11 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
17 views
MySQLdb INSERT data from JSON using Python error
I'm trying to insert data from a JSON to mysql using MySQLdb. The total number of columns are fixed. Each row of data from the JSON string does not always have values for each column.
Here is my ...
1
vote
0answers
36 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
20 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
29 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
115 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
217 views
connecting to mysql db on amazon rds
I am using python's MySQLdb module on a windows 7 machine and trying to connect to a remote database on Amazon RDS (SQL Server Express). Here is the simple connection scheme I am using to establish a ...
1
vote
0answers
208 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
82 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
50 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
165 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
100 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
84 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
442 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
169 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
280 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
600 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
403 views
Mysql-Python - Cannot Connect to MySQL Error Message
I am trying to execute the blog demo in the Tornado demo folder, though I need to get the MySQL software running for that one.
I installed a pre-compiled version of Python-Mysql and now when I try to ...
1
vote
0answers
674 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
6 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
9 views
Getting a mysql thread id from sqlalchemy Session
I'm used to creating connections using MySQLdb directly so I'm not sure this is at all possible using sqlalchemy, but is there a way to get the mysql connection thread id from a mysql Session a la ...
0
votes
0answers
15 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
55 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
142 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
21 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
59 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
24 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
50 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
64 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
5 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
45 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
63 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
65 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 ...
0
votes
0answers
30 views
Python MySQL insert behavior
I believe I am having trouble with how MySQLdb handles null string inserts. For example, in my insert statement the last parameter in the values list may be the empty string. Here is what my values ...
0
votes
0answers
17 views
Using Mysqldb module when writing to TIME datatype column
I have a mysql table, which have a column of TIME datatype. I use mysqldb module to access to the database.
What python datatype should I pass to execute function? I try datetime.timedelta and ...
0
votes
0answers
15 views
install python-mysql on python2.5
i am unable to install python-mysql for python2.5 and get the following error:
(cccorder2.5)☺ python -c "import MySQLdb" ...
0
votes
0answers
25 views
HTML, Python Server Pages: checkboxes, strage output?
I have this code:
import MySQLdb
cnx = MySQLdb.connect( host="biolarfs1",
user="Y1448743", passwd="Y1448743", db="Y1448743" )
name = form.getfirst('protein')
cur = cnx.cursor()
cur.execute("SELECT ...
0
votes
0answers
60 views
Why does this code not reconnect to the remote mysql server when the connection is interrupted?
I have a python script that I use on my Raspberry Pi to record temperature data of my homebrew. It stores the temperature data in both a local mysql database, and a remote mysql database (my personal ...
0
votes
0answers
27 views
node.js + python + mysql = Error: /usr/lib/python2.7/dist-packages/_mysql.so: undefined symbol: PyObject_GC_Del
Trying to use Python's MySQL library from node.js debian wheezy. With node module node-python I am able to run Python scripts in node.js. But, MysSQLdb seems to be a special problem
...
0
votes
0answers
67 views
MySQLDB cursor doesn't execute query but works my phpmyadmin
this code doesn't give any errors nor exceptions but it's not executed:
self.cur.execute('UPDATE roundshares SET shares = shares + 1, round = \'' + str(roundid) + '\', user_address = \'' + ...
0
votes
0answers
109 views
Inserting Pandas df date column into SQL
I am trying to insert a Pandas (using v. 0.11) dataframe into a mysql table using the Pandas io methods. The trouble I'm having is that one of the columns has dates where some of the values are loaded ...