MySQL Connector/Python is a pure-Python database adapter which enables Python programs to access to MySQL databases.

learn more… | top users | synonyms

0
votes
1answer
17 views

MySQL/Python — committed changes not appearing in loop

Using MySQL Connector/Python I have a loop that keeps checking a value for a change every 2 seconds. Without all the meat, here is the loop (the print is there for testing purposes: try: while ...
1
vote
0answers
20 views

Why mysql-connector returns eof row first when the SQL statement arguments are passed by reference?

When the arguments for a SQL statement in a function are passed by when calling the function, mysql-connector returns eof first and then 'columns' row. This results in displaying empty result by ...
0
votes
1answer
14 views

Python - accessing single database wrapper object from multiple objects

I have a simple Python wrapper around a MySQL database, and I need to be able to access it from inside other custom class objects within Python. The wrapper class lives in a separate file to each of ...
2
votes
0answers
26 views

On LOAD DATA LOCAL INFILE integer required error

I have a data file containing data in following format asd,12,asd,asd,12,adsd,,asdas,None I have a table in mysql which is has an auto increment int id and the rest of the columns as in data file. ...
0
votes
0answers
36 views

Installing mysql-connector-python for Python 3.4 on cloud

I have a cloud server with Ubuntu 14.04 and I'm having trouble to install the mysql-connector-python on it.. On windows, I used a installer .msi and it works fine, but on the server I already tried ...
0
votes
0answers
16 views

Install with .exe on cloud server

So, I have a cloud server to run a web-software with Python 3.4,PHP, and SQL, but my problem is that I use the mysql-connector-python==2.1.3 and can't install it with pip, always gets an error.. so I ...
3
votes
1answer
59 views

Python MySQL queries time out where MySQL workbench works fine

I recently had my website moved to a new server. I have some basic python scripts with access data in a MySQL database. On the old server we had no problems. On the new server : MySQLWorkbench can ...
0
votes
0answers
29 views

is MySQL Connector/Python C Extension greenlet(gevent) safe?

sorry for my poor english. I already know about MySQL Connector/Python(Pure Python ver) is greenlet safe. but i can't find whether MySQL Connector/Python C Extension is greenlet safe or not. ...
0
votes
0answers
23 views

Is there a way to preview what SQL command is actually given out by `execute` and `executemany`?

In the Python module sqlite3 and package mysql-connector-python, is there a way to preview what SQL command is actually given out by execute and executemany?
0
votes
1answer
44 views

Python mysql.connector InternalError: Unread result found when close cursor

I want to read part of result from cursor and then close it without reading all result. cursor.close() raises InternalError: Unread result found. Is it possible to close cursor without iterating ...
0
votes
1answer
48 views

How to specify port number using mysql-connector-python (error 2003)

I am trying to connect via SSH to a MySQL server from my local Windows machine. The SSH connection works fine, but I am unable to connect to the MySQL server when running the following Python script: ...
0
votes
2answers
33 views

More Effecient Way to Format Dates for in Python for MySQL

Say I have a list of dates that are formatted in one of the five ways below: Date_Type_1 = 2001 Apr 15 Date_Type_2 = 2001 Apr Date_Type_3 = 2000 Spring Date_Type_4 = 2000 Nov-Dec Date_Type_5 = 2001 ...
0
votes
1answer
23 views

Insert data in to mysql db using mysql.connector [duplicate]

I'm trying to insert some data into the table "billing accounts" and I tried the given below way. There was no error, how ever the data is not getting inserted into the table. am I doing anything ...
1
vote
2answers
19 views

How to not unpack all returned from a query?

I have the following query (notice not a normal SELECT): sql = "SHOW PROCEDURE STATUS WHERE Db <> 'sys' " Problem this returns many fields, which I need only the first two, see full code: ...
0
votes
1answer
45 views

MySQL Connector/Python InterfaceError: “Failed parsing EOF packet” only on specific host

To preface this, I realize this question has been asked before, but no resolution was ever reached. Hoping that two years might make a difference in understanding the issue. I am trying to ...
2
votes
1answer
265 views

MySQL Connector/Python as Django Engine?

Can't find an answer for this even after hours and hours of googling & searching stack overflow. I assure you I've seen all answers that could be deemed relevant and none of those have solved the ...
0
votes
1answer
75 views

PyMySQL not found on windows

I searched for a Python MySQL connector for Python3.4 on Windows, because I want to use SQLAlchemy as my MySQL ORM. People suggested PyMySQL as connector, which I installed with pip. Now when I try to ...
-1
votes
1answer
16 views

Access to MySql server-From any computer?

I am using mysql.connector package. I want to make sure it is possible to remotely connect to a database from any IP (especially from computers that MySql is not installed in) via basic authentication ...
0
votes
1answer
90 views

Calling MySQL stored procedures with backticked names using Connector/Python

I'm having trouble using MySQL Connector/Python to call stored procedures with names surrounded by backticks. I get the following syntax error when doing so with the cursor.callproc() method: mysql....
0
votes
1answer
169 views

Python3.5 Refuse to Work with MySQL Connector

I've read a few questions on here that people are having the same situation as me but no matter what method I tried, it just wouldn't work! According to MySQL documentation, MySQL-connector-python-2....
1
vote
1answer
192 views

Bulk update MySql with python

I have to update millions of row into MySQL. I am currently using for loop to execute query. To make the update faster I want to use executemany() of Python MySQL Connector, so that I can update in ...
0
votes
1answer
54 views

MySQL Query - SELECT 2 rows with 2 specific DISTINCT column values

My goal is, for each PID, to select 2 records with test_sname values of 'want' and 'want2' that occur on the same entry_date. I do this for the first 5 entry_dates that include both test_snames. ...
1
vote
1answer
186 views

python MySQL Connector

I'm playing with big data in Python and MySQL. I've a got a huge table, I need to insert new rows while I'm fetching query's results. I've got this error: Traceback (most recent call last): File "...
0
votes
0answers
17 views

Python and Load Data Local Infile results

I am using mysql.connector for Python to load data in Mysql. All seems to work all right, I just do not know how to retrieve the number of records inserted from the LOAD DATA query.
0
votes
0answers
82 views

MySQL Utilities 1.5.3 Install Not Recognizing mysql-connector-python

I am trying to install MySQL Utilities 1.5.3 (from rpm) on CentOS 6.7 and I keep getting a dependency error indicating that I need mysql-connector-python 2.0 or higher. I have installed version 2.0.2 ...
2
votes
2answers
75 views

MySQLConverter' object has no attribute '_tuple_to_mysql' exception with mysql-connector

I have 8 kinds of data that I would like to insert into a mysql table through mysql-connector using python. I have looked at some documents saying that it is better to use int, string, or tuple when ...
0
votes
0answers
52 views

How to get INSERT … ON DUPLICATE KEY UPDATE statements to work when batching?

I'm running a batch of insert statements, using python3 and mysql-connector-python. Some of those statements look like this: sql = "INSERT INTO ... ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id)" ...
1
vote
0answers
139 views

Django errors in migrating models to existing MySQL DB

BACKGROUND: I'm trying to build a database that supports many-to-many relationships using Django and an existing MySQL database as a next-step after going through the Django "polls" tutorial. I'm ...
0
votes
1answer
89 views

Installing Python Package to Conda Env Without Using Conda

I have a fresh Anaconda environment on a CentOS6 system that I would like to install the latest release of mysql-connector-python (v2.1.3) to. The problem is, the newest Conda-hosted package is 2.0.3 ...
1
vote
2answers
108 views

Why unexpected keyword 'multi' in Python's MySQLdb module?

I am trying to delete a record in database using MySQLdb module. In https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-execute.html, I found multi=True for executing ...
1
vote
0answers
75 views

mysql-connector-python loop over cursors very slow

I am not able to query a mysql database using mysql-connector-python (python version 3.5). I am trying to pull out air_temperature for a particular datetime range for an entire list of stations. The ...
4
votes
1answer
155 views

Python mysql-connector converts some strings into bytearray

I am using python3 and pandas to connect to some sql database: import pandas as pd import mysql.connector cnx = mysql.connector.connect(user='me', password='***', host='***'...
0
votes
0answers
166 views

MySQL Connector/Python Issue: Error 2055

I'm running a Python script daily triggered by a cron job. It uses MySQL Connector/Python v2.0.2 and Python 2.7. All of this is hosted on Dreamhost, if that is of any relevance. For about 7 months it ...
0
votes
0answers
25 views

MySQL INSERT command duration

I'm working on an assignment where I need to parse this huge JSON (1.5GB) and insert the data in MySQL using the INSERT command, and add up how long it takes to do that. I've got a script (pasted ...
1
vote
0answers
120 views

Python mysql.connector.pooling ImportError: No module named pooling

I am facing some difficulty when I try to run a Flask app. I get the following import error: File "/db/mysql_utils.py", line 2, in <module> import mysql.connector.pooling ImportError: No ...
5
votes
2answers
4k views

Could not find any downloads that satisfy the requirement mysql-connector-python

I'm trying to install mysql-connector-python and I'm getting the following error: Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.4 (from -r requirements.txt (...
12
votes
2answers
12k views

I cannot install mysql-connector-python using pip

I am trying to install mysql-connector-python==1.0.12 as part of my project's automated installation, and I get the following error from pip install: Collecting mysql-connector-python==1.0.12 (from -...
0
votes
1answer
44 views

How does one convert from mysql to python types using msqyl-connector

I know how to create a converter from python types to mysql types when using mysql-connector (see http://stackoverflow.com/a/19502805/1518546). However, how do I override the default conversion from ...
0
votes
2answers
58 views

Why won't start_transaction set the transaction isolation level?

The start_transaction method of the MySQLConnection class of mysql-connector-python doesn't seem to work as expected. >>> from mysql.connector import connect >>> conn = connect(user ...
11
votes
2answers
1k views

What are the differences between mysql-connector-python, mysql-connector-python-rf and mysql-connector-repackaged?

I'd like to use the mysql-connector library for python 3. I could use pymysql instead, but mysql-connector already has a connection pool implementation, while pymysql doesn't seem to have one. So this ...
0
votes
1answer
45 views

Syntax error with floats when inserting into a table

Im trying to insert data into a table using python but im getting a syntax error. Here is my table format. mycursor.execute("""CREATE TABLE workers ( `ID` int(5) NOT NULL ...
0
votes
0answers
68 views

Inserting values in to table in mysql using python shows no syntax error , but the record is not getting updated on db

I'm a newbie to python and i am trying to insert some data in to a mysql table .Seems the query executed with out any issues, however i don't see any record added on to the table. Any help would be ...
1
vote
3answers
6k views

Error in importing MySQL connector in Python 3.5

I am getting ImportError: No module named 'mysql' while I do the following... >>> import mysql.connector MySQL is installed and am on Python 3.5. I can't figure out. The above command is ...
1
vote
1answer
537 views

MySQL python connector IndexError: bytearray index out of range

I'm inserting some data to a database and most of the queries are inserted correctly but I keep getting at least one random query error. I'm using Python 3, MySQL 5.6.17 and MySQL python connector 2....
0
votes
0answers
23 views

mysql.connector.django not working [duplicate]

I am trying to deploy a Django web application with MySQL backend on an Amazon EC2 instance running Ubuntu 14.04. I am using the Oracle mysql-python connector but Django doesn't appear to work with ...
3
votes
1answer
138 views

Python MySql Select Single Column Returning Weird Values

I ran into this issue while making a practice script to teach myself some Python and about the mysql.connector library. When I perform a query with a single column and print the values, I get results ...
2
votes
0answers
49 views

Python MYSQL-connector backup creation

Current Problemset: Python application including mysql_connector object Remote Server only accessible using mysql (no ssh, rsh, telnet, etc.) Target: Use mysql connector to create a database ...
0
votes
1answer
473 views

spyder mysql connector python

I am having trouble with mysql-connector for python 2.7 while using the Anaconda Spyder IDE. Although the code below works in Python Gui, i get the following error in spyder: 'ImportError: No Module ...
0
votes
1answer
28 views

Python 3 Multidimentional List populated by existing MySQL table

I have an existing MySQL database that needs to change in rows with out rewriting code. I have referenced stackexchange Two dimensional array in python. Attempted those corrections (Examples maybe ...
0
votes
1answer
110 views

Ending a connection pool in mysql-connector-python

I have a connection pool that I create using mysql-connector-python: dbconfig = { "database": db, "user": "user" } cnxpool = mysql.connector.pooling.MySQLConnectionPool(...