mysql-connector-python 2.1.5

connector_invisibleThe installed version (mysql-connector-python-2.1.5-py3.4-winx64.msi) is undetected by Oracle’s MySQL

myqlconnector

connector…ending support for OS versions that are obsolete or have reached end of life, we plan to discontinue building all MySQL binaries for Microsoft Windows 7 as of June 23, 2016
http://www.mysql.com/support/eol-notice.html

MySQL 5.7.1 since ~ April 2013

mysql-connector-python 2.1.5
MySQL driver written in Python
https://pypi.python.org/pypi/mysql-connector-python is this page updated??
https://dev.mysql.com/downloads/connector/python/2.1.html

MySQL Connector/Python Developer Guide
http://dev.mysql.com/doc/connector-python/en/index.html
Chapter 1 Introduction to MySQL Connector/Python
http://dev.mysql.com/doc/connector-python/en/connector-python-introduction.html
up to and including MySQL Server version 5.7.
Chapter 3 Connector/Python Versions
http://dev.mysql.com/doc/connector-python/en/connector-python-versions.html
http://dev.mysql.com/doc/connector-python/en/connector-python-coding.html
Another recommendation is to declare a numeric primary key for each table, which offers the fastest way to look up values and can act as a pointer to associated values in other tables (a foreign key).

=======================

import mysql.connector

help(module)

dir(module)

mysql.connector.__version__

======================

For nonbuffered cursors, rows are not fetched from the server until a row-fetching method is called.
In this case, you must be sure to fetch all rows of the result set before executing any other statements on the same connection, or an InternalError (Unread result found) exception will be raised.
http://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursorbuffered.html
solution: cnx.close()

python34lib
python36lib

“developer milestone”
https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-2.html

Duplicate values in a SQL table

duplicatesmysql> use histology_db;
Database changed
mysql> SELECT word, count(word)
-> FROM dictionary
-> GROUP BY word
-> HAVING count(word) > 1;

create_viewCREATE VIEW duplicates AS

create_view_verbsCREATE VIEW verbs AS …

duplicate_verbsmysql> SELECT d.word_ID, LEFT(d.word, 10), d.category
-> FROM dictionary d
-> INNER JOIN (SELECT word
-> FROM dictionary
-> GROUP BY word
-> HAVING (count(word_ID) > 1) ) v
-> ON d.word = v.word;
+———+——————+———-+
| word_ID | LEFT(d.word, 10) | category |
+———+——————+———-+
| 15 | study | verb |
| 19 | study | noun |
| 57 | focus | noun |
| 160 | advance | noun |
| 183 | focus | verb |
| 193 | section | noun |
| 247 | section | verb |
| 343 | advance | Verb |
+———+——————+———-+

beam_of_electronsmysql> SELECT d.word_ID, LEFT(d.word, 10) AS multiple, d.category
-> FROM dictionary d
-> INNER JOIN (SELECT word
-> FROM dictionary
-> GROUP BY word
-> HAVING (count(word_ID) > 1) ) v
-> ON d.word = v.word
-> ORDER BY multiple, d.category;

http://stackoverflow.com/questions/2594829/finding-duplicate-values-in-a-sql-table
http://www.w3schools.com/sql/sql_join.asp

mysql> SELECT category, count(word_ID)
-> FROM dictionary
-> GROUP BY category;
+————–+—————-+
| category | count(word_ID) |
+————–+—————-+
| adjective | 58 |
| adverb | 8 |
| conjunction | 3 |
| determiner | 1 |
| noun | 201 |
| unclassified | 52 |
| verb | 61 |
+————–+—————-+

INNER JOIN
http://dev.mysql.com/doc/refman/5.6/en/example-foreign-keys.html

duplicate_values_and_conditionFinding a duplicate value, one of which has category=”unclassified”