What I Learned Today
Watching process list in mysql

Run show processlist; in a mysql terminal to see all currently running commands.

Also useful:  show table status;

Recovering Crashed Mysql tables

If you see error messages in /var/log/mysql.log about a table being crashed, log into the mysql console and run:  recover table;

Pretty easy!

For tpcw, you can use this script to recover everything:

repair table item;
repair table country;
repair table author;
repair table customer;
repair table orders;
repair table order_line;
repair table cc_xacts;
repair table address;
repair table shopping_cart;
repair table shopping_cart_line;

Mysql: Create new user

CREATE USER 'user1'@'%' IDENTIFIED BY 'pass1';
GRANT ALL ON *.* TO 'user1'@'%';

Mysql: Install (CentOS)

To install mysql on Centos:

sudo yum install -y mysql mysql-server
sudo /etc/init.d/mysqld start
sudo chkconfig --level 345 mysqld on ## To auto start at boot

Rubis: Update item end dates

When you create a rubis database it sets an end date for all items.  If you try to benchmarks the system after that end date, you will get funny results, since there will be no items for sale.  To deal with this, go into the DB and run:

UPDATE items SET start_date=NOW(), end_date=DATE_ADD(NOW(), INTERVAL 700 DAY);

Mysql change password

To change password in mysql, log in and type:

set password = password(‘NEWPASSWORD’);