Benchmarking MySQL

First make sure the right packages are installed. With Ubuntu the benchmark gets installed with mysql-server. With Red Hat/CentOS you have to ask for it under servers/MySQL/benchmarks
Ensure MySQL is running with:
service mysqld start # Red Hat/CentOS
/etc/init.d/mysql start # Ubuntu

# Make sure you have a root user created:
mysqladmin -u root password rootsqlpassword
Ubuntu required me to create a test database. (Create a test2 as well if you want to test two threads simultaneously.
mysqladmin -u root -p create test
# Navigate to the right directory:
cd /usr/share/sql-bench # Red Hat/CentOS
cd /usr/share/mysql/sql-bench # Ubuntu
OPT="--user root --password rootsqlpassword"
date; perl run-all-tests $OPT ; date
perl test-wisconsin $OPT --loop-count 100 # run the wisconsin test 100 times
# for two threads, open a second window and run the following at the same time:
date; perl run-all-tests $OPT ; date
# to run on another host:
date; perl run-all-tests $OPT --database test2 --host 192.168.1.102 ; date

To run from an Ubuntu live CD

# open up a terminal window
sudo passwd root
su
LIVEPW=xxxxxx
apt-get install -y mysql-server #will fail to start mysql, because of apparmor
# mysqladmin -u root password $LIVEPW #this will be done by the installer
/etc/init.d/apparmor stop # or you won't be able to start mysql
/etc/init.d/mysql start # this was attempted by the installer
cd /usr/share/mysql/sql-bench
mysqladmin -u root -p$LIVEPW create test
date; perl run-all-tests --user root --password $LIVEPW ; date
perl test-wisconsin --user root --password $LIVEPW --loop-count 100 # run the wisconsin test 100 times

To run tests in parallel

# create a second test database:
mysqladmin -u root -p create test2
# Open two windows. Cut and paste the OPT line into both (with the correct password)
OPT="--user root --password rootsqlpassword"
#I n the first, get ready to run:
date; perl test-insert $OPT --database test2 ; date
# In the second run the following, and then hit enter in the first console
perl test-alter-table $OPT ; perl test-connect $OPT ; perl test-select $OPT ; perl test-ATIS $OPT ; perl test-big-tables $OPT ; perl test-wisconsin $OPT
echo "2222222222222222222222222222222222222222222222222"
perl test-alter-table $OPT ; perl test-connect $OPT ; perl test-select $OPT ; perl test-ATIS $OPT ; perl test-big-tables $OPT ; perl test-wisconsin $OPT
echo "3333333333333333333333333333333333333333333333333"
perl test-alter-table $OPT ; perl test-connect $OPT ; perl test-select $OPT ; perl test-ATIS $OPT ; perl test-big-tables $OPT ; perl test-wisconsin $OPT
echo "4444444444444444444444444444444444444444444444444"
perl test-alter-table $OPT ; perl test-connect $OPT ; perl test-select $OPT ; perl test-ATIS $OPT ; perl test-big-tables $OPT ; perl test-wisconsin $OPT
echo "Other thread should be done by now!"

# The time of the test-insert should be measured while these tests repeat around 3.5 times