Archive for the ‘Linux’ Category

[Warning] User entry ‘username’@’hostname’ has an empty plugin value. The user will be ignored and no one can login with this user anymore.

After upgrading an instance of MySQL to 5.7 I was unable to login and had several of the following entries in the error log. [Warning] User entry ‘username’@’hostname’ has an empty plugin value. The user will be ignored and no one can login with this user anymore. This is explained the the release notes. Here’s […]

Installing the DBT2 Benchmark Tool on Linux

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

Migrate users between MySQL Servers with pt-show-grants

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 […]

Monitor /tmp usage on 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 […]

Linux Tip: Output error messages to syslog from cron

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: […]