What’s the most efficient way to convert a MySQL result set to a NumPy array?

This solution uses Kieth’s fromiter technique, but handles the two dimensional table structure of SQL results more intuitively. Also, it improves on Doug’s method by avoiding all the reshaping and flattening in python data types. Using a structured array we can read pretty much directly from the MySQL result into numpy, cutting out python data … Read more

Failed building wheel for mysql-python

Edit Please try installing the .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/. This works every time. Just type pip install MySQL_python‑1.2.5‑cp27‑none‑win32.whl in the terminal. Original Answer I had the same issue. You might find these steps helpful. Make sure you are in an activated virtualenv when you are installing anything through pip. Before you install anything, type pip … Read more

‘pip install MySQL-python’ fails with ‘IndexError’

Copy from this blog. By finding out the information that mysql-connector-cmight come to the conclusion that the configuration by brew installation may be incorrect , open the /usr/local/bin/mysql_config script to modify some of the contents of it: #Create options Libs = “-L$pkglibdir ” Libs = “$libs -l” change into: #Create options Libs = “-L$pkglibdir” Libs … Read more

About MySQLdb conn.autocommit(True)

by default MySQLdb autocommit is false, You can set autocommit to True in your MySQLdb connection like this, conn=MySQLdb.connect(host=”localhost”,user=”root”,passwd=”mysql”,db=”dang”,charset=”utf8″) conn.get_autocommit() #will return **False** conn.autocommit(True) conn.get_autocommit() #Should return **True** now cursor = conn.cursor()