2
votes
0answers
731 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
674 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 ...
1
vote
0answers
38 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 ...
1
vote
0answers
25 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
39 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
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
33 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
38 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
272 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
170 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
175 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 ...
0
votes
0answers
15 views

'Error:The used command is not allowed with this MySQL version' by mysqldb

I try use LOAD DATA LOCAL INFILE statement by mysqldb in python. I obtain follwing error. OperationalError: (1148, 'The used command is not allowed with this MySQL version') and I set the option in ...
0
votes
0answers
55 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
167 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
413 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
28 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
74 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
75 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
138 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
83 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
32 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
19 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
18 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
29 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
98 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
74 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
34 views

Python MySQLdb query formatting not working as expected

I am trying to create a simple function for returning distinct values from one column in a MySQL table. def get_distinct(column_name): sql = 'SELECT DISTINCT %s FROM mydb.mytable' ...
0
votes
0answers
102 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 ...
0
votes
0answers
66 views

Skip/continue past fatal errors with MySQLdb (Python)?

I'm currently trying to make a Rails app that uses the Apple Epf Importer (written in Python, using the MySQLdb module) to import data from the iTunes data feed. For the last few weeks the imports ...
0
votes
0answers
164 views

Python MySQLdb execute table variable (Scrapy)

First things first. I am runing my Scrapy scripts(version: 0.16.2) on Python 2.7.2+. The problem that I have is with pipe files and SQL syntax that I generate using MySQLdb library. Here is code that ...
0
votes
0answers
188 views

Can't connect to MySQL server on %s? - MySQLdb

I'm trying to connect to my internet server using python. To connect'm using MySQLdb library. The problem is that I can not connect with Python, but if using other programs, such as MySQL Workbench, ...
0
votes
0answers
35 views

Python MySQLdb get connection details

Is there a way to access information like the host, username, and password from a MySQLdb connection object after MySQLdb.connect() has already been called?
0
votes
0answers
335 views

how to enable mysqldb auto reconnect mysql

Mysqldb is a third-party module used by python to connect mysql.How to enable autoreconnect in Mysqldb so that we can use conn.ping(true) to reconnect a idle connection.
0
votes
0answers
180 views

Python test hangs when mysql truncate or drop is called

Using Windows 7, XAMPP, Mysql, the MySQLdb python connector and python 2.7. I'm developing tests for my first "real" application using the unittest module. In this test enviroment I first truncate ...
0
votes
0answers
51 views

please help me i got error #1064 in mysql file

Hope You are all fine, i have little problem in my SQL file, when i try to import it it,s show following error, 1064 - You have an error in your SQL syntax; check the manual that corresponds to ...
0
votes
0answers
220 views

Hook available for automatic retry after deadlock in django and mysql setup

I am using innoDB table in Django with mysql database. During investigation of error OperationalError: (1213, 'Deadlock found when trying to get lock; try restarting transaction') I came across ...
0
votes
0answers
282 views

No LOAD DATA support in stored procedures in MySQL?

Actually I am trying to use LOAD DATA statement in MySQL stored procedure but I am getting this error :- MySQL Database Error: LOAD DATA is not allowed in stored procedures. My Syntax is:- ...
0
votes
0answers
96 views

Simplifying Large SQL Prepared Statements in Python

I've made a Python script to insert some values from Excel Spreadsheets onto a mySQL database. I'm using mySQLdb and prepared statements. I am reading from multiple files with iterators, and each of ...
0
votes
0answers
88 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
0answers
75 views

MySQLdb return average of results

Its possible to return the average of selected data using MySQL, however I can't seem to do this using MySQLdb, my code is as follows cursor = database.cursor() cursor.execute ("SELECT AVG(points) ...
0
votes
0answers
81 views

Influence of forking on existing mysql-connection

I have a server which is/should be able to handle a lot of connections at the same time. Now sometimes I have an error: “Lost connection to MySQL server during query”. At the time I am fixing this ...
0
votes
0answers
34 views

Optimizing queries in Djano

I am creating a site using django. For testing I have created a database with 1 million rows each containing information(uploaders, orientation, description, and a handful of others) about images on ...
0
votes
0answers
215 views

SSH Tunneling and MySQLdb

This seems like a very typical use case, but I just can't get it to work correctly. I have set up an ssh tunnel with: ssh user@mySQLserver -NfL 3306:127.0.0.1:3306 I have no instance of mysqld on ...
0
votes
0answers
249 views

can't install python-mysql==1.2.3

Trying to setup mysql, django and GAE. Just finished installing mysql on my mac. However when doing sudo easy_install mysql-python==1.2.3 or downloading mysql-python and changing the mysql_config ...
0
votes
0answers
231 views

mysql play crazy with pymysql

I've something very strage with mysql 5.5, python 2.7, pymysql, os x 10.6.8 I've a mysql table id, name, fuzzy. I've generated a python list like cursor.execute('select id, SOUNDEX(name) from ...
0
votes
0answers
992 views

LOAD DATA INFILE not working with Python MySQLdb

I am trying to run the code below to insert data stored in a CSV file into a MySQL table. The table has a MyISAM engine but I've also tried it with an InnoDB engine with the same results. The code ...