A MySQL database creates a number of different data files in the mysql data directory (typically /var/lib/mysql). The following are the differences between the data files created:

File Extension Purpose
.frm table definition
.MYD table data
.MYI table indices

I believe these files are created for both MyISAM and InnoDB table types because the MySQL documentation references these types with respect to MyISAM and I definitely see them on my InnoDB tables.

I couldn’t find this information directly in the MySQL documentation and google wasn’t much help either so hopefully this post will save someone else some search effort.

Typically for loops in UNIX shell look like this:

for file in `ls *.c`
do
    cmd $file
done

However, the above has a serious problem in that it does not handle spaces in file names and will actually split the filename in two.

The following is a solution in bash:

files=(*.c)
for f in${files[@]}do
    cmd "$f"
done

But my favourite way to perform a loop and probably the most elegant solution is to use file globbing:

for f in *.c
do
    cmd "$f"
done

What is the difference between UNIX Access, Modify, and Change Times?

This is a silly little thing that I consistently forget … or at least forget some of the subtle differences between these three measures.
Continue reading »

This article describes common functionality that is often thought lacking in ksh but is just hiding in unintuitive corners (such as command line completion!)
Continue reading »

© 2013 rootsmith blog Suffusion theme by Sayontan Sinha