Showing entries 151 to 160 of 378
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: Python (reset)
The FOSDEM schedule in SQL

I thought it would be nice to be able to query the FOSDEM schedule for the MySQL devroom with SQL.

So I wrote a small Python script which downloads the schedule and inserts it into a MySQL database.

Some examples:

mysql> SELECT summary,dtstart,location,description FROM calendar 
-> WHERE calname='MySQL devroom'
-> AND MATCH (summary, description) AGAINST ('Fabric')\G
*************************** 1. row ***************************
summary: Sharding and Scale-out using MySQL Fabric
dtstart: 2014-02-01 16:05:00
location: UA2.114 (Baudoux)
description: MySQL Fabric is an open-source solution released by the MySQL Engineering team
at Oracle. It makes management of MySQL server farms easy and available for both applications 
with small and large number of servers.
1 row …
[Read more]
Installing MySQL Connector/Python using pip v1.5

The latest pip versions will fail on you when the packages it needs to install are not hosted on PyPI. When you try to install MySQL Connector/Python the usually way, you get following message is:

shell> pip install mysql-connector-python
  Could not find any downloads that satisfy the requirement 
    mysql-connector-python
  Some externally hosted files were ignored 
    (use --allow-external mysql-connector-python to allow).

I have updated the download URL to include the MD5 checksum, and MySQL Connector/Python should now install using pip using following command:

shell> pip install --allow-external mysql-connector-python \
  mysql-connector-python

Yes, you have to repeat the mysql-connector-python name. …

[Read more]
MySQL Connector/Python v1.1.4 GA

It has been a busy week for the Pythonic MySQL Team at Oracle: MySQL Utilities 1.3.6 and a brand new Utilities 1.4.1 Alpha has been release which includes Fabric. Yes, and of course, the one binding them all: Connector/Python v1.1.4 has been released as GA (General Available). Check out the Change History if you want to keep up with what is being added and changed.

New features found in v1.1:

  • Important: Connector/Python will not work with Python v2.4 or v2.5. Yes, I consider this a feature.
  • Connector/Python comes with it’s own …
[Read more]
New! MySQL Utilities release-1.3.6 GA

The MySQL Utilities Team is pleased to announce the latest GA release of MySQL Utilities. This release includes a number of improvements for usability, stability, and a few enhancements. We have also included a performance upgrade for exporting, importing, and copying databases.

Improvements
The following highlights a few of the more significant improvements.

* mysqldbexport, mysqldbimport, and mysqldbcopy have multiprocessing support that allows for much improved performance
* mysqlfrm can now generate a .frm file with storage engine substitution
* Mac OS X packages added!
* mysqlserverinfo now includes the log files (error, general, slow)
* mysqlprocgrep can now search and kill processes by id
* mysqlmetagrep can now search the body of routines with the new --body option
* all utilities report license type with --version and --help
* all utilities have the new …

[Read more]
MySQL Utilities: copy, replicate, show, failover… over and over again.

So, after installing Workbench 6.0.7 on my pc, and playing around with the MySQL Utilities that are included, I thought I’d do similar to what others have done (Thanks Tony D.) and share my experience on how I’ve used them. If you haven’t installed Workbench before, you might want to check your platform first: http://www.mysql.com/support/supportedplatforms/workbench.html.

So, even if you’re not using any of the recent versions and editions of Workbench (Utilities comes with all of them, Tools menu -> “Start Shell for MySQL Utilities“) you can just download the standalone scripts on a Linux machine. Flexibility being the name of the game again. …

[Read more]
MySQL Utilities: copy, replicate, show, failover… over and over again.

So, after installing Workbench 6.0.7 on my pc, and playing around with the MySQL Utilities that are included, I thought I’d do similar to what others have done (Thanks Tony D.) and share my experience on how I’ve used them. If you haven’t installed Workbench before, you might want to check your platform first: http://www.mysql.com/support/supportedplatforms/workbench.html.

So, even if you’re not using any of the recent versions and editions of Workbench (Utilities comes with all of them, Tools menu -> “Start Shell for MySQL Utilities“) you can just download the standalone scripts on a Linux machine. Flexibility being the name of the game again. …

[Read more]
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]
Data Analytics at NBCUniversal. Interview with Matthew Eric Bassett.

“The most valuable thing I’ve learned in this role is that judicious use of a little bit of knowledge can go a long way. I’ve seen colleagues and other companies get caught up in the “Big Data” craze by spend hundreds of thousands of pounds sterling on a Hadoop cluster that sees a few megabytes [...]

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]
Showing entries 151 to 160 of 378
« 10 Newer Entries | 10 Older Entries »