For a long time I’ve been maintaining a set of scripts inspired by Giuseppe Maxia’s MySQL Sandbox, which is a Swiss Army Knife for starting and stopping server instances for jobs such as testing, development, trying out a new version, and so on. My scripts are unpublished, until now. I’ve just kept them in my Dropbox’s bin folder, which I add to my $PATH. It’s not worth explaining why I use my own scripts, except for saying that I keep dozens or even more MySQL versions unpacked in my home directory at any given time, and I find it a little easier to use these lightweight scripts than the more fully-featured MySQL Sandbox tools.
Someone recently asked me why the wrong index was being used for a JOIN, making the query run very slowly. We ran EXPLAIN and saw this abridged output: explain select [columns] from m left join u on m.intcol = u.intcol and m.url = u.url where u.url is null\G *************************** 1. row *************************** select_type: SIMPLE table: m type: ALL rows: 2717 *************************** 2. row *************************** select_type: SIMPLE table: u type: ref key: idx_intcol key_len: 2 ref: m.
This post is one in a series that I will be doing on MySQL Workbench Utilities – Administer MySQL with Python Scripts.
MySQL Utilities are a part MySQL Workbench. The utilities are written in Python, available under the GPLv2 license, and are extendable using the supplied library. They are designed to work with Python 2.x greater than 2.6. If you don’t have Workbench, you may download the MySQL Utility scripts from launchpad.net. You will also need to …
[Read more]Over the next few months, I am going to be writing about the MySQL Utilities, and I will be posting links to each individual blog on this page.
If you haven’t heard of the MySQL Utilities (from the introduction to MySQL Utilities page):
“MySQL Utilities is a package of utilities that are used for maintenance and administration of MySQL servers. These utilities encapsulate a set of primitive commands, and bundles them so they can be used to perform macro operations with a single command. MySQL Utilities may be installed via MySQL Workbench, or as a standalone package. The utilities are written in Python, available under the GPLv2 license, and are extendable using the …
[Read more]It now seems impossible to maintain different ‘major’ MySQL servers on the same Windows machine using automated installers. Refer: http://bugs.mysql.com/bug.php?id=66395 and http://bugs.mysql.com/bug.php?id=66396 . This is an unnecesssary (and stupid) limitation/regression. Windows perfectly handles multiple MySQL versions at a time without use of Unix utilities like ‘mysql-multi’ or ‘mysql sandbox’, if only basedir, datadir, port and service names are distinct. Unix-people in MySQL organization (no matter the changing ownerships) never seem never to have understood this (I have had discussions with various MySQL people over the last 5-6 years about same and what came out was mostly sheer ignorance about Windows).
Todd Farmer blogged this …
[Read more]Blogging is the way to express an idea in an informal way by a person, who has either worked with it, or planning to work with it, or has seen it at work. In databases, ideas are the foundations of everything, and these Log Buffer Edition is presenting ideas from bloggers in Log Buffer #282. [...]
In the last weekend of September, MySQL Connect 2012 will take place in San Francisco as part of Oracle OpenWorld. MySQL Connect is a two day event that allows the attendees to focus on MySQL with the possibility to add on to Oracle OpenWorld or JavaOne.
I will be running the Hands-On Lab session Improving Performance with the MySQL Performance Schema (HOL10472) with the following abstract:
The Performance Schema is a tool first introduced in MySQL 5.5. It gives access to information about …
[Read more]It’s always interesting when somebody asks why they got an error message, and especially sweet when you’re working on something related that lets you answer the question. They were using MySQL Workbench and wanted to know why they couldn’t open a SQL script file by clicking on the Scripting menu option.
As I explained to the individual who asked, you should always click the Edit SQL Script link in the SQL Development section of the MySQL Workbench home page to work on SQL scripts. The Scripting menu option supports Python and Lua plug-ins development and scripts.
They did the following initially, which led down the rabbit warren and left them stumped because they don’t know anything about Python or Lua. This is provided to those who choose to experiment with this advanced feature of MySQL Workbench.
…
[Read more]Calculating the standard deviation in MySQL is a no-brainer by using the build-in aggregate function STDDEV(). If you don't need the original data and only want to save aggregated values in your database, the whole matter is getting more complicated - but is worth from a space and performance point of view.
Calculating the standard deviation in MySQL is a no-brainer by using the build-in aggregate function STDDEV(). If you don't need the original data and only want to save aggregated values in your database, the whole matter is getting more complicated - but is worth from a space and performance point of view.