Description:
If a MySQL database/schema name is exactly two letter long, then mysqlhotcopy will fail to backup
database. See the example below (ab is the database name).
--(Thu:20090507:1328)-(0:$)--
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)--
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- ls -l /var/lib/mysql/
total 28736
drwxr-xr-x 2 mysql mysql 4096 May 7 13:24 ab
drwxr-xr-x 2 mysql mysql 4096 May 7 13:27 cacti
-rw-rw---- 1 mysql mysql 18874368 May 7 13:27 ibdata1
-rw-rw---- 1 mysql mysql 5242880 May 7 13:27 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 May 3 00:35 ib_logfile1
drwx------ 2 mysql mysql 4096 May 3 00:35 mysql
srwxrwxrwx 1 mysql mysql 0 May 7 13:24 mysql.sock
drwx------ 2 mysql mysql 4096 May 3 00:35 test
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- ls -l /var/lib/mysql/ab/
total 24
-rwxr-xr-x 1 mysql mysql 8560 May 7 13:24 abc.frm
-rwxr-xr-x 1 mysql mysql 42 May 7 13:24 abc.MYD
-rwxr-xr-x 1 mysql mysql 1024 May 7 13:26 abc.MYI
-rwxr-xr-x 1 mysql mysql 65 May 7 13:24 db.opt
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- ls -l /var/lib/mysql/cacti/
total 24
-rwxr-xr-x 1 mysql mysql 8558 May 7 13:27 ab.frm
-rwxr-xr-x 1 mysql mysql 21 May 7 13:28 ab.MYD
-rwxr-xr-x 1 mysql mysql 1024 May 7 13:28 ab.MYI
-rwxr-xr-x 1 mysql mysql 65 May 7 13:27 db.opt
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)--
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- mysqlhotcopy --user=root ab /home/wang/
Locked 1 tables in 0 seconds.
Flushed tables (`ab`.`abc`) in 0 seconds.
Copying 4 files...
Copying indices for 0 files...
Unlocked tables.
mysqlhotcopy copied 1 tables (4 files) in 0 seconds (0 seconds overall).
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- mysqlhotcopy --user=root cacti /home/wang/
Locked 1 tables in 0 seconds.
Flushed tables (`cacti`.`ab`) in 0 seconds.
Copying 4 files...
Copying indices for 0 files...
Unlocked tables.
mysqlhotcopy copied 1 tables (4 files) in 0 seconds (0 seconds overall).
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1328)-(0:$)-- ls -l ab/
total 0
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1329)-(0:$)-- ls -l cacti/
total 24
-rwxr-xr-x 1 wang users 8558 May 7 13:27 ab.frm
-rwxr-xr-x 1 wang users 21 May 7 13:28 ab.MYD
-rwxr-xr-x 1 wang users 1024 May 7 13:28 ab.MYI
-rwxr-xr-x 1 wang users 65 May 7 13:27 db.opt
--(wang@picon)-(/home/wang)--
--(Thu:20090507:1329)-(0:$)--
I belive the this is happening because mysqlhotcopy thinks tables in two letter database/schema names are
RAID MyISAM tables and trying to deal with them as RAID tables. In fact these are not RAID tables at all (and
RAID MyISAM was removed in 5.0)
How to repeat:
- Create a database/schema (called aa) with a two letter name in MySQL and populate with MyISAM tables
- Create a database/schema (called aa) with a three letter name in MySQL and populate with MyISAM tables
- run mysqlhotcopy with database aa: mysqlhotcopy --user=user --password=password aa [DESTINATION]
- run mysqlhotcopy with database aaa: mysqlhotcopy --user=user --password=password aab [DESTINATION]
for database aa, it will copy NO files
for database aaa, it will work properly