Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
10 Newer Entries Showing entries 31 to 40 of 110 10 Older Entries

Displaying posts with tag: Maatkit (reset)

There is no apostrophe in Maatkit
+1 Vote Up -3Vote Down

Yes, Maatkit’s name was inspired by Ma’at, which has an apostrophe. But there is NO apostrophe in the name of the popular toolkit for MySQL users.

I’m just sayin’.

Related posts:

  • Learn about Maatkit at the MySQL Conference I’m
  • Speaking about Maatkit at CPOSC I’m
  • Making Maatkit more Open Source one step at a time If you
  • Related posts brought to you by Yet Another Related Posts Plugin.

    MySQL Permissions – Restarting MySQL
    +3 Vote Up -0Vote Down

    I am working with a client that is using managed hosting on dedicated servers. This has presented new challenges in obtaining the right permissions to undertake MySQL tasks but not have either ‘root’ or ‘mysql’ access and not have to involve a third party everytime.

    Adding the following to the /etc/sudoers file enabled the ability to restart MySQL.

    User_Alias	DBA = rbradfor, user2, etc
    Host_Alias 	DB_SERVERS =,, etc
    Cmnd_Alias	MYSQL = /etc/init.d/mysqld, /usr/sbin/tcpdump

    As you can see I also got tcpdump, which I find valuable to monitor via mk-query-digest.

    Next, permissions for log files.

    mk-query-digest now understands HTTP
    +1 Vote Up -0Vote Down

    You used to use mk-query-digest to aggregate and report on MySQL’s slow query log. Then it got the ability to grab query events from polling SHOW PROCESSLIST. Next we thought, really, how hard can it be to implement the libmysql wire protocol, so we can sniff TCP packets? … it’s hard, but not that hard as it turns out. But why stop there, why not implement memcached protocol too? I think you can see where this is headed.

    So now mk-query-digest is a tool that can understand and “do stuff with” a variety of query/response types of information. The latest is HTTP. HTTP traffic is just a query-response flow of events, perfectly suitable for response-time analysis. Example:

    baron@kanga:~$ mk-query-digest sample-http.txt --type http
    # 1.6s user time, 100ms system time, 14.20M
      [Read more...]
    Video: Building a MySQL Slave and Keeping it in Sync
    +5 Vote Up -0Vote Down

    Last night at the Boston MySQL User Group I presented on how to get a consistent snapshot to build a slave, how to use mk-table-checksum to check for differences between masters and slaves on an ongoing basis, and how to use tools such as mk-table-sync and mysqldump to sync the data if there are any discrepancies.

    The slides are online at

    The video can be watched on youtube at or directly in your browser with the embedded player below:

    Catching erroneous queries, without MySQL proxy
    +8 Vote Up -0Vote Down

    MySQL Proxy is a really neat tool. I remember a few years back when I first saw Jan talking about it. Back in those days it was significantly different than it is now, but the concept remains the same: direct your database traffic through a man-in-the-middle. Chris Calender’s post on capturing erroneous queries with MySQL Proxy shows one use for Proxy. But wait. MySQL Proxy is just inspecting the MySQL protocol. And unless you’re using it for something else too, having a man in the middle to catch errors is like standing in the middle of the street and blocking traffic to count the cars on the street. Why don’t you stand on the sidewalk to count the cars instead?

    Observing without interrupting

    Maybe we can use tcpdump. If you search Google you’ll see lots of

      [Read more...]
    Zero is a big number
    +0 Vote Up -0Vote Down

    I made changes to mk-query-digest yesterday that I didn’t expect to cause any adverse affects. On the contrary, several tests began to fail because a single new but harmless line began to appear in the expected output: “Databases 0″. Perhaps I’m preaching to the choir, as you are all fantastic, thorough and flawless programmers, but as for myself I’ve learned to never take a single failed test for granted.

    One time a test failed because some values differed by a millisecond or two. Being curious I investigated and found that our standard deviation equation was just shy of perfect. I fixed it and spent hours cross-checking the myriad tiny values with my TI calculator. Probably no one cared about 0.023 vs. 0.022 but it’s the cultivation of a disposition towards perfection that matters.

    My innocuous changes yesterday introduced a case of

      [Read more...]
    Making changes to many tables at once
    +1 Vote Up -2Vote Down

    As an alternative to another recent blog post that answered the question “how can I truncate all the tables in my database,” I thought I’d show another way to do it, which does not use the INFORMATION_SCHEMA.

    $ wget
    $ perl mk-find --exec 'TRUNCATE TABLE %D.%N'

    The other example is how to alter MyISAM tables to be InnoDB. That one’s easy, too. Let’s alter all MyISAM tables in the ‘test’ database:

    $ wget
    $ perl mk-find test --engine MyISAM --exec 'ALTER TABLE %D.%N ENGINE=InnoDB'

    If you want to print out the commands instead of executing them, you can just use –printf instead of

      [Read more...]
    mk-table-sync and small tables
    +4 Vote Up -0Vote Down

    Issue 634 made me wonder how the various mk-table-sync algorithms (Chunk, Nibble, GroupBy and Stream) perform when faced with a small number of rows. So I ran some quick, basic benchmarks.

    I used three tables, each with integer primary keys, having 109, 600 and 16k+ rows. I did two runs for each of the four algorithms: the first run used an empty destination table so all rows from the source had to be synced; the second run used an already synced destination table so all rows had to be checked but none were synced. I ran Perl with DProf to get simple wallclock and user time measurements.

    Here are the results for the first run:

      [Read more...]
    Filtering and analyzing queries by year, month, hour and day with mk-query-digest
    +1 Vote Up -0Vote Down

    I originally posted this on the Maatkit discussion list:

    A little while ago a user asked in if it was possible to use mk-query-digest to analyze queries per hour. I responded with a skeleton script for use with –filter, but I didn’t actually test this. Today, I filled out the script and tested it and found that it works. The script is available from trunk at:

      [Read more...]
    How to capture debugging information with mk-loadavg
    +1 Vote Up -2Vote Down

    Maatkit’s mk-loadavg tool is a helpful way to gather information about infrequent conditions on your database server (or any other server, really). We wrote it at Percona to help with those repeated cases of things like “every two weeks, my database stops processing queries for 30 seconds, but it’s not locked up and during this time there is nothing happening.” That’s pretty much impossible to catch in action, and these conditions can take months to resolve without the aid of good tools.

    In this blog post I’ll illustrate a very simple usage of mk-loadavg to help in solving a much smaller problem: find out what is happening on the database server during periods of CPU spikes that happen every

      [Read more...]
    10 Newer Entries Showing entries 31 to 40 of 110 10 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.