Skip to main content

Posts

Quick test run with infobright

After reading Jonathan Levin's article about infobright I decided I had to try Infobright. So I downloaded the 32-bit tarball. Normally I would have gone for a 64-bit build but those only came in RPM and DEB flavour. Then I tried to run infobright community edition (ICE) in a MySQL Sandbox, but that failed as the resolveip utility failed to give an answer for localhost. error while creating grant tables Neither host 'daniel-thinkpad' nor 'localhost' could be looked up with /home/dveeden/opt/mysql/4.0.7-ice/bin/resolveip Please configure the 'hostname' command to return a correct hostname. If you want to solve this at a later stage, restart this script with the --force option Then I used docker. This went really smooth. You can grab my docker file here . After creating a container with infobright I tried to insert some data... as I thought only UPDATE and DELETE were prohibited with ICE. But it turned out that also INSERT and ALTER TABLE .. ...

Notes on the AES encryption in MySQL

Oracle has improved the AES encryption/decryption functions in MySQL 5.6.17. They improved it a lot and posted a blog which explains all the details. If you would like to know more about encryption there are two resources I would recommend: The Code Book by Simon Singh. This is about the history of cryptography, but it also includes a lot of information about crypto which is currently in use. This is also a very entertaining read. Crypto 101 , a free/opensource book which gives a intro to crypto. The webpage also has a video of the talk on which the book is based. And if you're going to use the AES encryption functions in MySQL there are some things you should consider: Connections with a UNIX socket (or shared memory on Windows) should be safe. Local TCP/IP connections are also safe in most circumstances. Remote connections which use the AES encryption should use a protected connection (SSL, VPN, etc). Otherwise someone might be able to sniff the network traffice which...

Unittesting your indexes

During FOSDEM PGDay I watched the "Indexes: The neglected performance all-rounder" talk by Markus Winand. Both his talk and the "SQL Performance Explained" book (which is also available online ) are great. The conclusion of the talk is that we should put more effort in carefully designing indexes. But how can we make sure the indexes are really used now and in the future? We need to write some tests for it. So I wrote a small Python script to test index usage per query. This uses the JSON explain format available in MySQL 5.6. It's just a proof-of-concept so don't expect too much of it yet (but please sent pull requests!). A short example: #!/usr/bin/python3 import indextest class tester(indextest.IndexTester): def __init__(self): dbparams = { 'user': 'msandbox', 'password': 'msandbox', 'host': 'localhost', 'port': ...

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 in set (0.00 sec) mysql> SELECT summary,dtstart FROM calendar -> WHERE calname='MySQL devroom' ORDER BY dtstart DESC; +-------------------------------...

MySQL in Oracle Critical Patch Update Advisory January 2014

Oracle has released the Critical Patch Update (CPU) advisory for January 2014 . The affected MySQL products are: Oracle MySQL Enterprise Monitor, versions 2.3, 3.0  Oracle MySQL Server, versions 5.1, 5.5, 5.6 So this means that you should consider updating MySQL. For MySQL Enterprise the updates should be available on My Oracle Support and for the Community version the new versions are on the regular download locations . I guess the official repositories are already updated. For MySQL 5.6 you should upgrade to 5.6.15 For MySQL 5.5 you should upgrade to 5.5.35 For MySQL 5.1 you should upgrade to 5.1.73 If you use the MySQL release from your distribution you should ask them to fix the CVE numbers fixed in these releases (if they didn't do that already). The highest CVSS score for MEM is 10 and for MySQL the highest score is 6.8. Update: for more information see this blog post by Dave Stokes.

SSL with MySQL does not have to be complicated

I've blogged before about how complicated setting up SSL with MySQL can be. Since then many bugs have been fixed related to SSL. But still many people are using unencrypted connections for replication and client connections. This could be because of possible performance degradation. But then it could be used for only the admin connections. It could also be because they already use SSH or VPN. But for many it's because they think it's complicated. This is not necessary. I've created mysslgen which makes it easier to setup SSL. Just run mysslgen.py and then the CA, server and client certificates and keys will be generated for you. The most difficult part it to get python 3.3 or python 2.7 to run on CentOS/RHEL/OEL 6. If you think SSL should be part of the default MySQL installation, then click the 'Affects me' button for Bug #70734 . During the creation of mysslgen I found out MySQL fails to load private keys if they are in PKCS#8 format ( Bug #71271 ...