Use this tag for questions about the MySQL-Python database connector library (MySQLdb). Do not use this tag for questions about MySQL Connector/Python (use the [tag:mysql-connector-python] tag instead).
3
votes
0answers
912 views
mysql-python install fatal error
I am trying to pip install mysql-python connector but it keeps erroring on me. Works fine on my mac and another windows machine but not this one. I have downloaded visual studio c++ and tried it as 32 ...
3
votes
0answers
250 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
42 views
Errors installing mysql-python on Azure
Unsure if I should be using Server Overflow or not... Using Django websites on Azure, deploying via GitHub... I have mysql-python in the requirements.txt and even went as far to add the site-packages ...
2
votes
0answers
466 views
Anaconda python : gcc.exe: error: /Zl: No such file or directory
please help !!
I'm trying to resolve some python exercices , so in the begining I was trying to resolve the problem of importing MySQLdb , I used this command : pip install MySQL-python under the ...
2
votes
0answers
379 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
914 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
789 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
196 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
626 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 ...
2
votes
0answers
252 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
170 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
781 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
32 views
How to Install MySQLdb in PyCharm, Windows
I am new to Python(I am using Python2.6) and Pycharm, but I need to use MySQLdb module to complete my task.
I found How to install MySQLdb in Python 2.6 CentOS but I need it at Windows 7(64 bits)
...
1
vote
0answers
143 views
How to pass a Dynamic column name to a function parameter in MySql?
Okay, I'm only looking for a work around now. Could some one guide me?
EDIT:
Okay, So apparantly there's no way to get a function to call a dynamic procedure in MySql.
But I really need to do this ...
1
vote
0answers
36 views
Cursor execution - Python
I am working on a Django project where i use MySql database. In my project, one of the method used two cursor connections to execute the query. It was closed correctly.
The MySql database has a table ...
1
vote
0answers
43 views
No module named MySQLdb error
When I use the python console and use
import MySQLdb
no errors occur.
When i use a bash script
#!/usr/bin/python
import MySQLdb
I get the following errors
File "./jaccard.py", line 2, in ...
1
vote
0answers
97 views
nohup process doesn't keep running in background when used in python script
I want to run below mysql query on remote server in background.
nohup mysql -h10.0.100.1 -P3306 -utest -ppassword -Dcms -e "select * from table1 ;" & echo $!
When above command is execute ...
1
vote
0answers
28 views
python MySQLdb insert on update cannot handle more than 20 columns in update
In python I am inserting into a table using "insert on update keyword". However when a certain number of columns are used in the update statement the query goes on forever. I have to kill it ...
1
vote
0answers
55 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
108 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
46 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
188 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
87 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
129 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
60 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
1k 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
...
1
vote
0answers
281 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
253 views
Executing MySQL SELECT * query in parallel
I have a multithreaded application that periodically fetches the whole content of the MySQL table (with SELECT * FROM query)
The application is written in python, uses threading module to ...
1
vote
0answers
938 views
error: command 'gcc' failed with exit status 1-centos
I am trying to install Mysql-python connector for mysql.I am facing this error"error: command 'gcc' failed with exit status 1"
I tried with installation of
1.gcc using yum install gcc
2.python-devel ...
1
vote
0answers
397 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
95 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
61 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
178 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
120 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
209 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
178 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
454 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
693 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
9 views
Making sense of MySQL Binary with python
I am trying to extract some meaning out of a column in a MySQL table. The contents of one item in that column using MySQLdb is below:
('\x05E\t\xef\x17\xa4\xd9\x00\x08\x10\x00\x
...
0
votes
0answers
11 views
How to improve the performance of my MySQL server
I am new to MySQL and recently I built a server on my 2010 iMac (3.06 GHz dual core Intel core i3, 8GB memory and 500GB HDD). I use python scripts to retrieve the information from some websites. Each ...
0
votes
0answers
8 views
Python setuptools: How to define installation time conditional dependencies for dist package?
I make dist packeges of my module, which depends on MySQL-python. I realized, that some users don't have MySQL installed, and therefore it's easier for them to install pymysql (python based client) as ...
0
votes
0answers
16 views
RaspberryPi server database access by a client raspberryPi
I'm trying to access a database created in my server raspberrypi with the ip address 192.168.0.105 from my client raspberryPi with the address 192.168.0.103
I have already created a mysqldb database ...
0
votes
0answers
7 views
Does Any Version Of Py2Exe Support MySQLdb Module?
I am using Py2Exe to convert Python into .exe file.
Now I have installed MySQLdb module into Python 2.7.
Can Py2exe still convert my Python script which contains MySQL connection into Exe file?
0
votes
0answers
25 views
Mysql cluster Dll issue (DLL Load Failed
sir,
i am new to MySql Clustering. I had downloaded the mysql-cluster-gpl-7.3.8-win32.msi from this url"http://dev.mysql.com/downloads/cluster/".
I tried Mysql Clustering in single machine it works ...
0
votes
0answers
18 views
trouble installing MySQL-Python-1.2 on Mac
preamble -
I work on Mac OS X 10.6
I have Python v2.6 and v2.7
I have MySQL v5.1.73
problem-
I downloaded MySQL-Python-1.2.4b4 but when I try to do the install process trough setup.py it gives ...
0
votes
0answers
13 views
Connection “loop” with pymysql/mysqldb
Is it actually possible to do a connection loop each minute to check if the script still has a connection to the database or maybe it timed out?
If something happened, for example it disconnected, ...
0
votes
0answers
16 views
How to get results with one cursor and many queries with Python MySQLdb?
This does not work:
query_string = 'set @whatever := 1; select "whatever this query has to say";'
db = MySQLdb.connect(...)
cur = db.cursor()
cur.execute(query_string)
first_row = cur.fetchall()
...
0
votes
0answers
29 views
Issue inserting values in MySQL using the MySQLdb library of python
I have phpmyadmin version 4.0.10.6 and MySQL version 5.1.73 on my hosting server. I am using MySQLdb to insert values into the database...i am able to read the values using the SELECT statement, but i ...
0
votes
0answers
29 views
Python Mysqldb Error in Ubuntu
I work on an web project.I try to connect web.py to mysql, but I take an error like this:
Traceback (most recent call last):
File "project.py", line 17, in <module>
db = ...
0
votes
0answers
18 views
Python's MySQLdb stuck during TRUNCATE statement
I try to do the following: cur.execute("TRUNCATE TABLE words") (using a connection con and a cursor cur = con.cursor that worked elsewhere).
The strange thing is, it worked with other tables. I tried ...