Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 30 of 197 Next 30 Older Entries

Displaying posts with tag: work (reset)

MySQL Connector/Python 1.0.10 available for download
Employee +5 Vote Up -0Vote Down

Last week we released MySQL (http://www.mysql.com) 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
Employee +4 Vote Up -0Vote Down

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

  [Read more...]
MySQL Connector/Python 1.0.9 available for download
Employee +1 Vote Up -0Vote Down

Today we released MySQL (http://www.mysql.com) Connector/Python v1.0.9. Release notes can be found in the MySQL Developver Zone.

Connector/Python v1.0.9 contains some important fixes, especially for the Windows platform. It also comes with a new connection argument called force_ipv6, and can be used to force IPv6 when an address resolves to both IPv4 and v6. Also, RPM packages have been made available in addition to the TAR/ZIP and MSI packages.

Please use the MySQL Bugs website to report any problem.

Some useful links:

  • Documentation:
  [Read more...]
Change management of database scripts
+1 Vote Up -0Vote Down
In this post I’m going to discuss the strategy used by our team to manage the changes taking place in the database. Most of the time we as developers mainly focus on implementing the feature and put less effort on manage the database changes. For instance individual might not straight away see the importance in […]
MySQL Connector/Python 1.0.8 available for download
Employee +1 Vote Up -0Vote Down

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!
Employee +1 Vote Up -0Vote Down

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...]
Talking about Python at MySQL Connect 2012
Employee +1 Vote Up -0Vote Down

Love Python? Dig MySQL (http://www.mysql.com" target="_blank)? Want to meet Oracle’s MySQL Python Experts?

Come and join us at the MySQL Connect 2012 conference in San Fransisco next week, 29/30 September. My colleague Chuck and I are both giving 3 sessions in which we discuss MySQL Utilities and Connector/Python.

Overview of our session:

  [Read more...]
MySQL Connector/Python v1.0.6 beta available
Employee +3 Vote Up -0Vote Down

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

  [Read more...]
Fetching rows as dictionaries with MySQL Connector/Python (revised)
Employee +4 Vote Up -0Vote Down

It is possible with MySQL Connector/Python to define your own cursor classes. A very good use case is to return rows as dictionary instead of tuples. This post shows how to do this using MySQL Connector/Python v1.0 and is an update for an older blog entry.

In the example below we are subclassing the MySQLCursor class to create a new class called MySQLCursorDict. We change the _row_to_python() method to return a dictionary instead of a tuple. The keys of the dictionary will be (unicode) column names.

from pprint import pprint
import mysql.connector

class MySQLCursorDict(mysql.connector.cursor.MySQLCursor):
    def _row_to_python(self, rowdata, desc=None):
        row
  [Read more...]
MySQL Connector/Python Launchpad entry updated
Employee +6 Vote Up -0Vote Down

We finally got the MySQL Connector/Python repositories reorganised on Launchpad. The following changes have been made:

  • Old, unmaintained repositories have been marked as obsolete.
  • Downloadable source distributions of obsolete versions have been removed, use the MySQL download website.
  • Connector/Python v1.0 source has been uploaded to Launchpad up till v1.0.5b1.
  • URLs point to the MySQL website.
  • Maintainer is now ‘Oracle/MySQL Engineering’, the team I (Geert Vanderkelen) am part of.
Linus on Instantiation and Armadaification
+0 Vote Up -1Vote Down

I feel a sense of pride when I think that I was involved in the development and maintenance of what was probably the first piece of software accepted into Debian which then had and still has direct up-stream support from Microsoft. The world is a better place for having Microsoft in it. The first operating system I ever ran on an 08086-based CPU was MS-DOS 2.x. I remember how thrilled I was when we got to see how my friend’s 80286 system ran BBS software that would cause a modem to dial a local system and display the application as if it were running on a local machine. Totally sweet.

When we were living at 6162 NE Middle in the nine-eight 292, we got an 80386 which ran Doom. Yeah, the original one, not the fancy new one with the double barrel shotgun, but it would probably run that one, too.

  [Read more...]
MySQL Connector/Python 1.0.5 beta available through PyPI
Employee +4 Vote Up -0Vote Down

Yesterday we announced the availability of MySQL Connector/Python v1.0.5 beta. Today I’ve made it available on PyPI so it can be easily installed. Note that I did remove the old development release and when you upgrade or try v1.0.5, you should check the ChangeLog.

shell> pip install mysql-connector-python

For those wondering why the name includes ‘python’: it’s just to align it with other MySQL connectors and to keep the name consistent with other distribution types.

We welcome and appreciate feedback and comments for this first beta release through the

  [Read more...]
MySQL Connector/Python v1.0.5 beta available for download
Employee +1 Vote Up -0Vote Down

MySQL Connector/Python v1.0.5 beta is now available for download from the MySQL website. This version is feature complete and we welcome and appreciate feedback and bug reports.

We’re also interested in hearing your feedback for future enhancements. Let us know how you’re using the connector too, especially if you are using it with Django, SQLAlchemy and similar Python technologies.

A few things have changed since the last development releases and we hope the manual shipping with the Connector/Python distribution (and also available online soon) will help you get up to speed.

Here are a few important changes that might be incompatible with current scripts using the now obsolete development

  [Read more...]
Naming a Python package for distribution?
Employee +0 Vote Up -0Vote Down

I’m currently figuring out how to name the MySQL Connector/Python distributions so it works well with PyPi. Source archives would be named like mysql-connector-python-X.Y.Z.tar.gz.

The ‘name’ metadata would be ‘MySQL Connector Python’, thus without any underscores or dashes. This works OK, but if people have objections, please leave a comment.

NIST::NVD::Store::SQLite3 1.00.00
+0 Vote Up -0Vote Down

It’s been released. Use this with NIST::NVD 1.00.00 and you will be able to perform immediate look-ups of CVE and CWE data given a CPE URN. For instance:

cjac@foxtrot:/usr/src/git/f5/NIST-NVD-Store-SQLite3$ perl Makefile.PL ; make ; make test ; cjac@foxtrot:/usr/src/git/f5/NIST-NVD-Store-SQLite3$ perl -MNIST::NVD::Query -MData::Dumper -e '
$q = NIST::NVD::Query->new(store    => q{SQLite3},database => q{t/data/nvdcve-2.0.db});
$cve_list = $q->cve_for_cpe( cpe => q{cpe:/a:microsoft:ie:7.0.5730.11} );
print Data::Dumper::Dumper { cve_list => $cve_list, first_cvss => $q->cve( cve_id => $cve_list->[0] )->{q{vuln:cvss}} }
'
$VAR1 = {
          'cve_list' => [
                          'CVE-2002-2435',
                          'CVE-2010-5071'
                        ],
          'first_cvss' => {
  [Read more...]
NIST::NVD 1.00.00
+0 Vote Up -0Vote Down

I’m leaving myself some room for bug fixes. It works for us in house. I would love to help others to give it a try. especially those who could benefit from making nearly immediately answered queries to the NIST’s NVD database.

The code in this release cannot by itself track the feed from the feds in real time. The nvd entry loader needs a little bit of love in the area of record merging before this starts working. It’s on my TODO list.

I’m sorry for the outage of git.colliertech.org. I’ll get that back up here shortly. In the meantime, feel free to grab it from this location while the CPAN indexes and processes my submission.

http://www.colliertech.org/federal/NIST/NIST-NVD-1.00.00.tar.bz2

don’t forget to check the cryptographic signature:

  [Read more...]
Bootstrapping & Running MySQL server standalone on Windows
Employee +1 Vote Up -0Vote Down

Two extra tips when you try to (manually) bootstrap MySQL on Windows from the command line:

  • When bootstrapping, use --no-defaults or --defaults-file.
  • Use --standalone when starting the MySQL server.
  • The first point really bugged me yesterday. I’m used to installing MySQL manually and having no option files available where MySQL would read them by default.

    On Windows, however, I used the MySQL installer. So, when I launch unit testing for Connector/Python it bugged me saying log files of InnoDB didn’t match the configuration. This is indeed a newbie error..

    Invalid dates returning None, or raise error using Connector/Python?
    Employee +0 Vote Up -0Vote Down

    In this blog we discuss invalid dates in MySQL (http://www.mysql.com" target="_blank), how to retrieve them using Connector/Python and we raise the question: Should Connector/Python raise an error or just keep returning None on invalid dates?

    If you run MySQL without proper SQL Modes, you will be able to update and
    read invalid dates such as ’2012-06-00′. If you’ve payed attention the past decade, you’ll know that you can prevent this configuring your MySQL server setting SQL Mode to ‘TRADITIONAL’.

    Now, the problem if this is allowed, how do we get invalid dates using MySQL Connector/Python?

    Lets look at an example inserting an invalid date and trying to read


      [Read more...]
    Monitoring and Managing Amazon RDS Databases using MySQL Workbench
    +0 Vote Up -0Vote Down
    Last couple of week I was looking for an easier approch to manage the Databases created on Amazon RDS instances. I had to run through a tedious set of steps in carrying out routine stuff like introducing new updates, taking daily backups and moving it to an Amazon S3 bucket, etc… Before getting into touch […]
    MySQL Connector/Python bugs reports on bugs.mysql.com
    Employee +0 Vote Up -0Vote Down

    We have moved bugs for MySQL Connector/Python from Launchpad to the MySQL Bugs website http://bugs.mysql.com. Reports which are (probably) fixed in newer code were not taken with. If there is a bug which you really want to get tracked: please report it again.

    Please use the MySQL Bugs website to report problems using MySQL Connector/Python. To see a list of active reports, click here.

      [Read more...]
    NIST::NVD::Store::SQLite3
    +0 Vote Up -0Vote Down

    I published an SQLite3 storage back-end to NIST::NVD on the CPAN. It’s pretty quick. About as fast as the DB_File one, but without the down side of being tied to DB_File. It shouldn’t be too difficult to re-factor this code to any DBI-based database. MariaDB anyone?

    I know it works on Debian. The nightly CPAN test results should come back shortly and I’ll find out how well it works on other platforms.

    Automatic reconnect in MySQL Connector/Python?
    Employee +0 Vote Up -0Vote Down

    There have been some request to have some reconnect possibilities in Connector/Python. I’m wondering now whether there should be some automatic reconnect on certain errors within the database driver.

    My personal feeling is to have no automatic reconnect within Connector/Python and the programmer has to come up with retrying transactions herself.

    For example:

    	cnx.disconnect() # For testing..
    	tries = 2
    	while tries > 0:
    		tries -= 1
    		try:
    			cursor.execute("INSERT INTO t1 (c1) VALUES ('ham')")
    			cnx.commit()
    		except mysql.connector.InterfaceError:
    			if tries == 0:
    				print "Failed inserting data after retrying"
    				break
    			else:
    				print "Reconnecting.."
    				cnx.reconnect()
    		else:
    			break
    

    The above mimics how you would handle

      [Read more...]
    Perl interface to processing / querying NIST’s NVD feed
    +0 Vote Up -0Vote Down

    For a work project, I wrote a library in perl that can be used to query the NVD feed that NIST publishes here:

    http://nvd.nist.gov/download.cfm

    Here’s a snippit from the perldoc:

    use NIST::NVD::Query;
     
    # use convert_nvdcve to generate these files from the XML dumps at
    # http://nvd.nist.gov/download.cfm
     
    my( $path_to_db, $path_to_idx_cpe ) = @ARGV;
     
    my $q = NIST::NVD::Query->new( database => $path_to_db,
                                   idx_cpe  => $path_to_idx_cpe,
                                  );
     
    # Given a Common Platform Enumeration urn, returns a list of known
    # CVE IDs
     
    my $cve_id_list = $q->cve_for_cpe( cpe => 'cpe:/a:zaal:tgt:1.0.6' );
     
    my @entry;
     
    foreach my $cve_id ( @$cve_id_list ){
     
      # Given a CVE ID, returns a CVE
      [Read more...]
    MySQL Connector/Python available through the Python Package Index
    Employee +2 Vote Up -0Vote Down

    Today we registered MySQL Connector/Python with the Python Package Index (PyPI). It makes installing your favorite connector even easier (provided you first install setuptools or pip):

    shell> easy_install mysql-connector
    shell> pip install mysql-connector
    

    Please report problems either using Launchpad or MySQL Bugs website.

    MySQL Connector/Python bug category on bugs.mysql.com
    Employee +0 Vote Up -0Vote Down

    In addition to reporting MySQL Connector/Python bugs on Launchpad, it is now also possible to enter them using http://bugs.mysql.com.

    My New Job at Oracle: Working on MySQL Connector/Python
    Employee +2 Vote Up -0Vote Down

    After more than 6 years doing MySQL Support for MySQL (http://www.mysql.com) AB, Sun Microsystems, and Oracle, it’s time for a change. Time to get back to development!

    As of November 2011 I’ll be working full-time on MySQL Connector/Python and other goodies within the MySQL development team at Oracle. Before, this was more or less a pet project done after working hours. However, with the birth of our son Tomas more than a year ago, I’ve been slacking and family got priority.

    The idea is to make MySQL Connector/Python the best choice for connecting to MySQL from within your Python code. We still got a long road

      [Read more...]
    Debugging MySQL Cluster installed using RPMs using gdb
    Employee +1 Vote Up -0Vote Down

    This post explains how to debug MySQL Cluster 7.1, installed using the RPM packages, using gdb on a Linux box (Red Hat, Oracle Enterprise Linux, CentOS, ..).

    When a data node crashes lots of information goes into the error log, trace files and out log. However, it makes sometimes sense when you can repeat the crash, to run the data node in debug mode, or using gdb.

    First, using RPMs and a Linux distribution, make sure you have the ‘debuginfo’ package installed. For example, for Red Hat or Oracle Enterprise Linux on a 64-bit machine, this package would be called: MySQL-Cluster-gpl-debuginfo-7.1.15-1.rhel5.x86_64.rpm .

    Create a file with the following commands, we will name it ‘ndbd.gdb’:

    set
      [Read more...]
    MySQL Cluster: Rotating the log file of the Data Nodes
    Employee +2 Vote Up -0Vote Down

    There is a log file called ndb_<NodeID>_out.log created by the MySQL Cluster (http://www.mysql.com/products/cluster/) data nodes which can become quite big overtime. There is, unlike the cluster logs created by the management nodes, no rotation build in. So you have to revert to the basics and copy the file away, truncating the old one.

    For example, if you want to ‘rotate’ the log file of data node with NodeID 3:

    shell> mv ndb_3_out.log.1.gz ndb_3_out.log.2.gz
    shell> cp ndb_3_out.log ndb_3_out.log.1
    shell> cat /dev/null > ndb_3_out.log
    shell> gzip ndb_3_out.log.1
    

    It’s not elegant, and you might lose some entries, but it will help you keeping disk usage minimal. If you don’t need the log at all, just line 3 would do the trick.

    You can use

      [Read more...]
    Refactored: Poor man’s MySQL replication monitoring
    Employee +2 Vote Up -0Vote Down

    This is a reply to the blog post Poor man’s MySQL replication monitoring. Haidong Ji had a few problems using MySQLdb (could use the ‘dict’ cursor) and apparently he doesn’t want to much dependencies. I agree that using the mysql client tool is a nice alternative if you don’t want to use any 3rd party Python modules. And the MySQL client tools are usually and should be installed with the server.

    However, since MySQL Connector/Python only needs itself and Python, dependencies are reduced to a minimum.

      [Read more...]
    Custom logger for your MySQL Cluster data nodes
    Employee_Team +2 Vote Up -0Vote Down

    The MySQL Cluster data node log files can become very big. The best solution is to actually fix the underlying problem. But if you know what you are doing, you can work around it and filter out these annoying log entries.

    An example of ‘annoying’ entries is when you run MySQL Cluster on virtual machines (not good!) and disks and OS can’t follow any more; a few lines from the ndb_X_out.log:

    2011-04-03 10:52:31 [ndbd] WARNING  -- Ndb kernel thread 0 is stuck in: Scanning Timers elapsed=100
    2011-04-03 10:52:31 [ndbd] INFO     -- timerHandlingLab now: 1301820751642 sent: 1301820751395 diff: 247
    2011-04-03 10:52:31 [ndbd] INFO     -- Watchdog: User time: 296  System time: 536
    2011-04-03 10:52:31 [ndbd] INFO     -- Watchdog: User time: 296  System time: 536
    2011-04-03 10:52:31
      [Read more...]
    Showing entries 1 to 30 of 197 Next 30 Older Entries

    Planet MySQL © 1995, 2013, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.