Posted on May 30, 2013, 6:37 pm, by Rhys, under
DBA,
Linux,
MySQL.
Just recording the process I used to install the DBT2 bench-marking tool. I used OpenSuSE 12.1 for this but should work on many distributions. ?View Code BASHcd /opt/src wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz tar xvf dbt2-0.37.50.3.tar.gz cd dbt2-0.37.50.3/ ./configure –with-mysql make make install Don’t forget to read the documentaiton to start running MySQL benchmarks… cat README-MYSQL
Posted on February 5, 2013, 9:40 am, by Rhys, under
DBA,
Linux,
MySQL.
If you use MySQL but don’t use Percona Toolkit you’re really missing a trick. It contains a whole host of useful tools including pt-show-grants which I use to migrate users between servers easily. ?View Code BASHpt-show-grants –host mysqlservername –user username –password secret | mysql -h localhost -u username -p If you want to filter out any [...]
Posted on October 6, 2012, 4:18 pm, by Rhys, under
Linux.
Just a quick post to show how to monitor usage of /tmp on a Linux system. Setup a cron job as follows… ?View Code BASH* * * * * df -h | grep "/tmp" >> /tmp/tmp.log This job will run every one minute logging details of /tmp usage to a file called tmp.log. To report [...]
Posted on July 5, 2012, 5:53 pm, by Rhys, under
Bash,
Linux.
I wanted to find a way of running a script in cron and output the exit code, and error message, to syslog if it failed. Here’s what I came up with… ?View Code BASHoutput=`/usr/bin/scripts/test.sh 2>&1`; code=$?; if [ "$code" -ne 0 ]; then err_msg=`echo "$output" | tail -1`; logger -t "CRONERROR" "Exit Code = $code: [...]
Posted on June 12, 2012, 11:27 am, by Rhys, under
Bash,
Linux.
I like to know what’s happening on my Linux servers. The output of the history command doesn’t include a datetime stamp by default. To rectify this open the global profile…. ?View Code BASHvi /etc/profile Add the following line to the bottom. ?View Code BASHexport HISTTIMEFORMAT="%h %d %H:%M:%S " The output of the history command will [...]