MySQL Cheat Sheet
Create new database for each webapp/environment:
CREATE DATABASE new_db;
GRANT ALL PRIVILEGES ON new_db.* TO 'some_user'@'localhost'
IDENTIFIED BY 'somepassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Get approximate disk usage by table in your database:
SELECT table_name, (data_length+index_length)/power(1024,2) tablesize_mb
FROM information_schema.tables
WHERE table_schema='shoptool'
GROUP BY table_name
ORDER BY 2 DESC;
See what table engine (MyISAM, InnoDB) each of your database tables is using:
SELECT table_name, engine
FROM information_schema.tables
WHERE table_schema='your_db_name';