I've written quite a few tools over time to connect to many mysql
servers and run queries. Most of these have been pretty specific
to a small set of tasks such as running an alter across many
servers. Any sysadmin that is in charge of many servers is
probably familiar with dsh, and as I was using recently I
realized how all those specific tools I've written for mysql
could be generalized into a dsh like tool. Thus, Qsh.pl was born!
(download at
launchpad)
Usage should be familiar to anyone who has used dsh before, it
even will read group files made for dsh in /etc/dsh/group/or
/usr/local/etc/group/.
Here's an example where this tool was quite useful. I was getting
a query error for SHOW GLOBAL STATUS. This was a curious result
since we're running mysql 5.0 everywhere. So what better way to
find out which machines are complaining than just run it
everywhere:
…
Dear Lazy Web,
What should the result of the SELECT be below? Assume InnoDB for all storage engines.
CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1),(1,2); CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 VALUES (100,100); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (PRIMARY KEY (a)) SELECT * FROM t1; # The above statement will correctly produce an ERROR 23000: Duplicate entry '1' for key 'PRIMARY' # What should the below result be? SELECT * FROM t2; COMMIT;
If you do not know what International Women’s Day is: http://www.internationalwomensday.com/
Start planning your blog posts for Ada Lovelace day now (March 24th, http://findingada.com/ Ada Lovelace Day is an international day of blogging (videologging, podcasting, comic drawing etc.!) to draw attention to the achievements of women in technology and science.)
To that end, I would like to point out all the women currently in
science and tech fields that I admire and think are doing great
things. I think it would be great if everyone, male or female,
made a list like this:
The women that have taught me science/tech along the way:
High School:
Mary Lou Ciavarra (Physics)
Maria Petretti (Pre-Algebra, and Academic Decathlon)
Reneé Fishman (Biology)
Lisa Acquaire …
MySQL is a constantly moving target and keeping up on the latest
changes can be a difficult chore. A lot of folks seeking
certification are often swamped by evolutions in the MySQL
product. On Tuesday there is a FREE web seminar where
MySQL Professional Services experts will walk you through best
practices for achieving performance and scalability improvements
using MySQL 5.1 and the new InnoDB Plugin. This is part two of
the series and you do not have to have seen part one to
join.
List of Web Seminars
MySQL has a number of global buffers, i.e. your SGA. There are also a number of per session/thread buffers that combined with other memory usage constitutes an unbounded PGA. One of the most common errors in mis-configured MySQL environments is the setting of the 4 primary per session buffers thinking they are global buffers.
Global buffers include:
-
- key_buffer_size – For MyISAM Indexes (note you can define multiple key_buffer’s The MyISAM Key Cache)
- innodb_buffer_pool_size – For Innodb …
It took a while, but here they are. We have posted only the slides from Sun/MySQL, since the other material is copyright by Infobright and Talend.
Today, while on IRC in #pentaho I came across a discussion and a published my.cnf. In this configuration I found some grossly incorrect values for per session buffers (see below).
It doesn’t take a MySQL expert to spot the issues, however there is plenty of bad information available on the Internet and developers not knowing MySQL well can easily be mislead. This has spurred me to create a program to rid the world of bad MySQL configuration. While my task is potential infinite, it will enable me to give back and hopefully do a small amount of good. You never know, saving those CPU cycles may save energy and help the planet.
Stay tuned for more details of my program.
[mysqld] ... sort_buffer_size = 6144K myisam_sort_buffer_size = 1G join_buffer_size = 1G bulk_insert_buffer_size = 1G read_buffer_size = 6144K read_rnd_buffer_size = 6144K key_buffer_size = 1024M max_allowed_packet = 32M thread_stack = …[Read more]
Since I left Sun back in January, folks have been asking what was next. I’m happy to say that I’m going to continue hacking on open source projects like Drizzle and Gearman, but now at the Rackspace Cloud. Not only will I be there, but I get to continue working closely with a few of the amazing Drizzle hackers who have also joined, including Monty Taylor, Jay Pipes, Stewart Smith, and Lee Bieber.
Why Rackspace Cloud? Late last year I was considering what I wanted to do next with the Oracle acquisition looming near, and this was one of the options that …
[Read more]Let me start by saying the majority of environments never experience problems of MySQL crashing. I have seen production environments up for years. On my own server I have seen 575 days of MySQL uptime and the problem was hardware, not MySQL.
However it does occur, and the reasons may be obscure.
Confirming mysqld has crashed
To the unsuspecting, MySQL may indeed be crashing and you never know about it. The reason is because most MySQL installations have two running processes, these are mysqld and mysqld_safe.
ps -ef | grep mysqld root 28822 1 0 Feb22 ? 00:00:00 /bin/sh bin/mysqld_safe mysql 28910 28822 0 Feb22 ? 00:30:08 /opt/mysql51/bin/mysqld --basedir=/opt/mysql51 --datadir=/opt/mysql51/data --user=mysql --log-error=/opt/mysql51/log/error.log --pid-file=/opt/mysql51/data/dc1.onegreendog.com.pid
One of the functions of mysqld_safe is to restart mysqld if it fails. Unless you review …
[Read more]
Before all my fellow DBAs' heads explode, let me just say that I
am a relational guy. I like the relational model, think it's the
best tool for the job, and think every programmer (not just
DBA's) should aspire to be as familiar with it as they are with
AJAX, MVC, or whatever other technology pattern you think is
important. I'll even take that a step further; I think the NoSQL
movement is mostly a re-hash of failed technologies from the last
century. Object and document databases had their run in the
market (some might say "they had their time"), and they were pretty
thoroughly beaten by the RDBMS; that some people have reinvented
that wheel doesn't change the game.
That said, I find the recent comments from Jeff Davis on the relational model and scalability …