Archive for 27th May 2010

MySQL Tips

The following is simply a gathering of easy hints, tips and scripts for MySQL beginners (and a memory aid for me!):

 

Useful MySQL queries

 

List all your databases and their total sizes

SELECT table_schema “Database Name”, sum( data_length + index_length ) / 1024 / 1024 “Database Size in MB”

FROM information_schema.TABLES GROUP BY table_schema ;

 

List all your tables in a specific database and their total sizes

SELECT table_schema “Database Name”,
table_name “Table Name”,
sum( data_length + index_length ) / 1024 / 1024 “Table Size in MB”
FROM information_schema.TABLES
WHERE table_schema like “[insertyourdatabasenamehere]
GROUP BY table_name
ORDER BY table_schema,table_name;

 

Dump a database contents out to a gzipped file and skip certain tables

mysqldump -u[username] -p [databasename] –ignore-table=[insertyourdatabasenamehere].[tabletoignore1]

–ignore-table=
[insertyourdatabasenamehere] .
[tabletoignore2] | gzip -c > sqlfile.sql.gz

 

Run an SQL script file against a database

mysql -u[username] -p [databasename] < sqlfile.sql

 

Easy!

Post to Twitter Post to Facebook Post to Delicious Post to Digg Post to LinkedIn Post to Reddit Post to StumbleUpon

Photography Course

canon-eos-450dx100I recently started attending the Digital Improvers photography course at East Berks College in Windsor. It’s a 10 week course which goes beyond teaching you how to use the camera, and instead how to simply produce better photos using styles and techniques you would not necessarily have tried before. To see some of the work I’ve been doing on the course, see my flickr page here:

Digital Improvers

Hope you enjoy!

Post to Twitter Post to Facebook Post to Delicious Post to Digg Post to LinkedIn Post to Reddit Post to StumbleUpon

Welcome to Tekhead.org

Welcome to the latest incarnation of Tekhead.org, home of Alex Galbraith on the net. You can also get here by going to alexgalbraith.com.

This site contains a bit of info about me and links to my other presences on the web.

If I can find the time I may even put a few updates!

Cheers

Alex

Post to Twitter Post to Facebook Post to Delicious Post to Digg Post to LinkedIn Post to Reddit Post to StumbleUpon

Stop censorship