Showing entries 21 to 30 of 69
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: myconnpy (reset)
MySQL Connector/Python v1.1.3 beta

Connector/Python v1.1.3 is available for testing since last week. It is a “beta” release, so it would be great if we even get more feedback. Check out the Change History if you want to keep up with what is being added and changed.

Notable changes for v1.1.3 include a fix for encoding using \x5c or backslashes in multi-byte characters. We also made the code more PEP-8 compliant, which we think is quiet important.

Some useful links:

[Read more]
Snippet: Show column information using MySQL Connector/Python

Problem

You have a query executed by MySQL Connector/Python and would like to show column information nicely on the console.

Solution

Every cursor object has a description property. This can be used to show information about the columns in a result set.

columns = []
maxnamesize = 0
for coldesc in cur.description:
    coldesc = list(coldesc)
    coldesc[2:6] = []
    columns.append(coldesc)
    namesize = len(coldesc[0])
    if namesize > maxnamesize:
        maxnamesize = namesize

fmt = "{{nr:3}} {{name:{0}}} {{type:12}} {{null}}".format(
    maxnamesize+1)
colnr = 1
for column in columns:
    (colname, fieldtype, nullok, colflags) = column
    print(fmt.format(
        nr=colnr,
        name=colname,
        null='NOT …
[Read more]
MySQL Fabric support in Connector/Python

MySQL Fabric was officially introduced during Tomas his keynote at MySQL Connect 2013. MySQL Fabric will help you managing lots of MySQL server supporting both high-availability and sharding. Just like Connector/J, MySQL Connector/Python v1.1.1 Alpha has support for MySQL Fabric on MySQL Labs. Note that the MySQL Fabric as well as support for it in Connector/Python is Alpha.

When you download MySQL Connector/Python from MySQL Labs, you will also see a ZIP archive containing the MySQL Utilities documentation …

[Read more]
MySQL Connector/Python v1.1.1 alpha: With Pooling and Django!

Connector/Python v1.1.1 is available for testing. It’s the second of a series of alpha releases which will bring some new features. Check out the Change History if you want to keep up with what is being added and changed.

Notable changes for v1.1.1:

Connector/Python v1.1.1 is alpha and although in good shape, it’s advised not to use it in production just yet.

Some …

[Read more]
MySQL Connector/Python v1.0.12 released

A few weeks ago we released MySQL Connector/Python v1.0.12. Bugs were fixed, and LOAD DATA LOCAL INFILE should now work correctly. The announcement can be read on the MySQL forums.

Some useful links:

[Read more]
MySQL Connector/Python 1.0.10 available for download

Last week we released MySQL Connector/Python v1.0.10. Release notes can be found in the MySQL Developver Zone.

A notable fix in Connector/Python v1.0.10 which might interest a few users is adding support for LOAD DATA LOCAL INFILE. It allows you to import CSV using a simple SQL statement.

Please use the MySQL Bugs website to report any problem.

Some useful links:

  • Documentation: …
[Read more]
Using Connector/Python with SQLAlchemy

SQLAchemy has support for MySQL Connector/Python for a while now. Here is a little HOWTO showing how install both, and setup a database engine.

There are multiple ways of installing both projects, but here is the simplest using pip, whatever platform you use:

shell> pip install SQLAlchemy
shell> pip install mysql-connector-python 

Start your SQLAlchemy engines using a URL pointing to Connector/Python. Note the connect_args argument which passes extra connection arguments to Connector/Python. In the following example we set the MySQL session variable time_zone …

[Read more]
MySQL Connector/Python 1.0.8 available for download

Last week we made a maintenance release for MySQL Connector v1.0 available. The announcement can be read in the MySQL forums and the history log is available online.

Connector/Python v1.0.8 does not introduce anything new, it only comes with bug fixes. Some are quite important and it’s probably good to upgrade.

Please use the MySQL Bugs website to report any problem.

Some useful links:

[Read more]
MySQL Connector/Python v1.0 goes GA!

Today, during MySQL Connect 2012 keynote, the General Availability of MySQL Connector/Python 1.0 was announced! This is the first GA release of Oracle’s pure Python database driver for MySQL.

MySQL Connector/Python v1.0 works with MySQL 5.5 and 5.6, but older versions of the MySQL servers are known to work. For Python, version v2.6, v2.7 and v3.1 and greater are officially supported. Python v2.4/2.5 are know to work as well.

As always, we welcome your feedback and questions through our bug system or using the MySQL Python forum.

Some useful links:

  • Documentation: …
[Read more]
MySQL Connector/Python v1.0.6 beta available

We released the second beta of MySQL Connector/Python v1.0. You can download v1.0.6 from the MySQL website and the change history can be found in the online manual.

Usually, beta releases do not have big changes, but we had to push some code which did not make the previous one and it really had to go into v1.0. The exceptions raised by Connector/Python are now mapped against the ‘SQLState’ found in the MySQL server errors. This makes it much easier to maintain and clearer which exception can be expected. It is, however, possible to override how errors are …

[Read more]
Showing entries 21 to 30 of 69
« 10 Newer Entries | 10 Older Entries »