Category: mysql

  • On the fly compression of a tar-ball or mysqldump

    Just to jot it down lest I forget:

    Tar’ing the local directory and streaming the tarball straight to gzip:

    tar cvf - . | gzip > target.tar.gz

    MySQLdump’ing directly to gzip: (more…)

  • Secure SSH Tunneling – at no extra cost

    Assuming you have a Windows machine and you interact with Linux boxen at any stage, chances are high that you have used and interacted with PuTTY at one stage or another. That beautiful, less than 2 sec, 444K download of a tool (currently at version 0.60 beta) allows you to SSH, COM-direct, RSH, Telnet etc from the desktop. Both examples below relate to MySQL port tunneling.

    SSH Tunnels using the Bash command line

    Running on a proper machine (or even a Windows with Cygwin or a Mac Terminal) allows you to quickly tunnel a session to a remote server: (more…)

  • [SOLVED] mysql-server5.1.5.141-3ubuntu12.1 hangs on upgrade

    There are a lot of words about the MySQL upgrade on Ubuntu 10.04 (64 bit specifically, perhaps the 32bit version too?) — it just hangs:

    You get the hopeful message:

    Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12.1

    but then nothing happens and everything just hangs. (more…)

  • Security Summit 2010 Wrap-Up

    So the Security Summit 2010 has come to an end. Featuring speakers such as Moxie Marlinspike, Joe Grand and Jeremiah Grossman (again), it’s a pity to say that there wasn’t much new that was presented. With repeated concerns about input- and output-validation, as the OWASP Top 10 for 2010 highlight and were used as a repeated example, and a call for a holistic approach to a company’s security posture, the idea of making the thought (and practice) of security part of the organisation’s culture came through over and over again. (more…)

  • MySQL Database optimization

    Just to have them all in one place, and for posterity’s sake, I’ve pulled together some points on how to optimise your MySQL programming.

    First off, the result of Session 1 of MySQL Camp 1:

    1. Use EXPLAIN to profile the query execution plan
    2. Use Slow Query Log (always have it on!)
    3. Don’t use DISTINCT when you have or could use GROUP BY
    4. Insert performance
      1. Batch INSERT and REPLACE
      2. Use LOAD DATA instead of INSERT
    5. LIMIT m,n may not be as fast as it sounds
    6. Don’t use ORDER BY RAND() if you have > ~2K records (more…)