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 中文
Previous 30 Newer Entries Showing entries 31 to 60 of 211 Next 30 Older Entries

Displaying posts with tag: work (reset)

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...]
    +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
    			cursor.execute("INSERT INTO t1 (c1) VALUES ('ham')")
    		except mysql.connector.InterfaceError:
    			if tries == 0:
    				print "Failed inserting data after retrying"
    				print "Reconnecting.."

    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:


    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’:

      [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...]
    Load balancing SIP across Asterisk with BIG-IP
    +0 Vote Up -0Vote Down


    Participating hosts

    * 1x BIG-IP VE
    * 1x Debian Squeeze “Provisioning Server” serving DHCP, TFTP & DNS
    * 3x Nortel/Avaya 1120E hard phones flashed to SIP1120e04.01.13.00
    * 2x Debian Squeeze + digium asterisk packages:

    $ grep asterisk /etc/apt/sources.list
    deb http://packages.asterisk.org/deb squeeze main
    deb-src http://packages.asterisk.org/deb squeeze main


    *CLI> module reload pbx_dundi.so
    *CLI> dundi show peers
    *CLI> dundi show mappings
    *CLI> dundi lookup 4012@extensions bypass
    *CLI> dundi set debug on


    *CLI> sip show peers


    *CLI> dialplan show RegisteredDevices

    Work in progress

    Yesterday, I installed a trixbox virtual machine using the

      [Read more...]
    MySQL Performance Tuning at PHPBenelux 2011 Conference
    Employee_Team +3 Vote Up -0Vote Down

    I’ll be giving a workshop/tutorial on MySQL Performance Tuning at the PHPBenelux 2011 Conference in Belgium. It’s 3.5 hours and I am sure I can discuss the new MySQL v5.5 (http://www.mysql.com/news-and-events/web-seminars/display-597.html) release too.

    Lots of stuff will be discussed, including configuration, understanding status variables, finding bad queries, schema tips, etc..

    If you got particular ideas or concerns and are attending, just leave me message or just comment on this blog post. I’ll see if I can fit it in.

    Maybe we can fix the deadlocks in Belgian politics too? Ah, who am I kidding..

    MySQL Connector/Python v0.3.2-devel released
    Employee_Team +1 Vote Up -0Vote Down

    MySQL Connector/Python 0.3.2, a development release, is available for download:

    Disclaimer: Since version 0.3 is still a development release, or ‘alpha’, it is not
    recommended to run this in production.

    MySQL Connector/Python 0.3.2-devel is a maintenance release fixing following bugs:

    • lp:701081 -Doesn’t install with Python 2.4

    About MySQL Connector/Python: MySQL Connector/Python is implementing the
    MySQL Client/Server protocol completely in Python. No MySQL libraries
    are needed, and no compilation is necessary to run this Python DB API v2.0

      [Read more...]
    MySQL Connector/Python v0.3.1-devel released
    Employee_Team +3 Vote Up -0Vote Down

    MySQL Connector/Python 0.3.1, a development release, is available for download:

    Disclaimer: Since version 0.3.1 is still a development release, or ‘alpha’, it is not
    recommended to run this in production.

    MySQL Connector/Python 0.3.1-devel is a maintenance release fixing following bugs:

    • lp:695514 – Infinite recursion when setting connection client_flags
    • lp:691836 – Incorrect substitution by cursor.execute when tuple args contains ‘%s’

    About MySQL Connector/Python: MySQL

      [Read more...]
    Setting client flags with MySQL Connector/Python
    Employee_Team +3 Vote Up -0Vote Down

    Setting client flags with MySQL Connector/Python works a bit differently than the other MySQL Python drivers. This blog post describes how to set and unset flags, like the CLIENT_FOUND_ROWS.

    The default client flags for the MySQL Client/Server protocol can be retrieved using the constants.ClientFlag class:

    >>> from mysql.connector.constants import ClientFlag
    >>> defaults = ClientFlag.get_default()
    >>> print ClientFlag.get_bit_info(defaults)

    To set an extra flag when connecting to MySQL you use the client_flags argument of connect()-method. For example, you’d

      [Read more...]
    MySQL v5.5 and Python
    Employee_Team +3 Vote Up -0Vote Down

    MySQL (http://www.mysql.com) v5.5 is GA, but is it working with Python? Yes, it does. Below you’ll find some quick, small tests I did with MySQLdb, oursql and our own MySQL Connector/Python.

    My desktop is a Mac, but when it works on that, I’m sure it works elsewhere too. If not, just let us know!

    MySQL for Python (aka MySQLdb)

    Installing MySQL v5.5.8 64-bit from tar ball on MacOS X 10.6, it compiled fine and the module loaded giving me the expected result:

    >>> import MySQLdb
    >>> cnx =
      [Read more...]
    This blog served by MySQL v5.5
    Employee_Team +4 Vote Up -0Vote Down

    MySQL (http://www.mysql.com) v5.5 is GA and my blog, using WordPress 3.0, runs on it.

    My personal highlight of this new MySQL version? The fact that it is released by Oracle.

    MySQL Connector/Python 0.3.0 has been released!
    Employee_Team +5 Vote Up -0Vote Down

    MySQL Connector/Python 0.3.0, a development release, is available for download:

    Since version 0.3.0 is still a development release, or ‘alpha’, it is not
    recommended to run this in production.

    MySQL Connector/Python 0.3.0 adds following features:

    • Python v2.4 support is back.
    • Support for compressed protocol.
    • Support for SSL connections (when Python’s ssl module is available).
    • Support for packets which are bigger than 16MB.
    • Max allowed packetsize defaults to 1GB.
    • Some performance improvements.

    See the ChangeLog for extra details.

    Please report bugs and comments

      [Read more...]
    Query caching with MySQL Connector/Python
    Employee_Team +2 Vote Up -0Vote Down

    This blog post shows how to create a cursor class for MySQL Connector/Python which will allow you to cache queries. It will hold the query itself and the result in a global variable.

    Note: this is a proof of concept and is only meant as a demonstration on how to extend MySQL Connector/Python.

    Why query caching?

    You are doing lots of queries that have the same result. It would be expensive to always run the same exact query. MySQL has already a query cache, and there is also memcached. But you like MySQL Connector/Python so much you’d like to do it yourself.

    A cursor caching queries and their result

    To demonstrate a simple implementation of a query cache, we inherit from an existing

      [Read more...]
    Buffering results with MySQL Connector/Python
    Employee_Team +2 Vote Up -0Vote Down

    MySQL Connector/Python doesn’t buffer results by default. This means you have to fetch the rows when you issued a SELECT. This post describes how you can change this behavior.

    Why buffering result sets?

    Buffering or storing the result set on the client side is handy when you, for example, would like to use multiple cursors per connection and you’de like to traverse each one interleaved.

    Keep in mind that with bigger result sets, the client side will use more memory. You just need to find out for yourself what’s best. When you know result sets are mostly small, you might opt to buffer.

    MySQLdb by default buffers results and you need to use a different cursor to disable it. oursql does not buffer by default. This is good to know

      [Read more...]
    New Job, Community Manager for Eucalyptus Systems
    +7 Vote Up -0Vote Down
    Six months ago, right around the O'Reilly MySQL Conference, my previous employer, Gear6, suffered from "unfortunate cash flow event". That is, they ran out of money faster than their sales grew. Which is too bad, it was a good company with good and useful products, and it was staffed with good people. I appreciate the honest and ethical dealings of the board and the executive staff, who kept the we the staff "in the light" as the situation developed, and did things like paying out the accumulated vacation time and such. No bounced paychecks, unpaid expense reports, or surprise locked doors.

    I spent the time working on personal projects, preparing for and going to Burning Man, studying up more on open source community management, digging more into cloud computing, and interviewing at a number of interesting companies.

    And now,

      [Read more...]
    Fetching rows as dictionaries with MySQL Connector/Python
    Employee_Team +4 Vote Up -1Vote Down

    This post describes how to make a custom cursor returning rows as dictionaries using MySQL Connctor/Python v0.2 (or later).

    Problem: you want to fetch rows from the database and return them as a dictionary with keys being the column names.

    First, lets check how you would do it without any custom cursor.

    cnx = mysql.connector.connect(host='localhost',database='test')
    cur = cnx.cursor()
    cur.execute("SELECT c1, c2 FROM t1")
    result = []
    columns = tuple( [d[0].decode('utf8') for d in cur.description] )
    for row in cur:
      result.append(dict(zip(columns, row)))
    The above results in an output like this:
    [python light="true"]
    [{u'c1': datetime.datetime(2010, 10, 13, 8, 55, 35), u'c2': u'ham'},
      [Read more...]
    MySQL Connector/Python 0.2-devel available
    Employee_Team +5 Vote Up -1Vote Down

    Next development release v0.2.0 of MySQL Connector/Python is available for download and testing. We still don’t recommend to use it in production: it is not beta or GA yet, but we are getting there.

    Bug reports and feature requests are welcome through the Launchpad bug tracking tool.


    • .executemany() now optimizes INSERT statements using the MySQL
      multiple row syntax.
    • Setting sql_mode and time_zone when connecting as well as collation.
    • Raw Cursors can be used when you want to do the conversion yourself.
    • Unittests now bootstrap own MySQL server instance.
    • Tidying the source tree.

    Full list of changes and bug fixes can be found

      [Read more...]
    Scribd is Hiring (I’m Looking for an Operations Engineer to Join My Team)
    +0 Vote Up -0Vote Down

    Scribd is a top 100 site on the web and one of the largest sites built using Ruby on Rails. As one of the first rails sites to reach scale, we’ve built a lot of infrastructure and solved a lot of challenges to get Scribd to where it is today. We actively try to push the envelope and have contributed substantial work back to the open source community.

    Scribd has an agile, startup culture and an unusually close working relationship between engineering and ops. You’ll regularly find cross-over work at Scribd, with ops people writing application-layer code and engineers figuring out operations-level problems. We think we’re able to make that work because of the uniquely talented people we have on the team.

    To allow us to keep scaling, we’re now looking to add a

      [Read more...]
    Cool Web Designer is Looking for Work
    +0 Vote Up -0Vote Down

    My wife – a good web designer with 6 years of experience with web design, HTML and CSS is looking for a job. Here is some information about her:

    We’re physically located in Toronto, Canada, but she has a great experience of working remotely too. So, if you need a web designer or a junior web designer, feel free to contact Tanya.

      [Read more...]
    Introduction to memcached
    +0 Vote Up -0Vote Down

    These are the slides to a talk I did earlier this week for students of the professional bachelor in ICT course at KaHo St. Lieven. I wanted to give a clear and simple introduction to the memcached service, as I think it’s an invaluable tool in today’s web development.

    Previous 30 Newer Entries Showing entries 31 to 60 of 211 Next 30 Older Entries

    Planet MySQL © 1995, 2014, 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.