Tuesday, April 24, 2012

USB Storage failed to mount after apt-get upgrade on sheevaplug

After using apt-get upgrade on the debian squeeze on the sheevaplug, I found the my external usb complex drive was not working anymore
#dmesg shows:

scsi_mod: Unknown symbol blk_get_queue

After did a little bit research, it seems need to execute command


and reboot my sheevaplug, the driver was back!!!

Friday, April 20, 2012

Mysql Change current database characterset

Assuming you have a database with default character set latin-1 & wish to convert it to utf-8, it is very simple to convert it without any external tool

1. Dump the database:

mysqldump -h localhost -u changeit -pchangeit --opt --compatible=mysql40 --default-character-set=latin1 database>database.sql

parameter –compatible=mysql40 is to dump the database without charset settings.

2. Create a database utf8 default:

CREATE DATABASE `database_new` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

3. Reimport the database

mysql -h localhost -u changeit -pchangeit --default-character-set=utf8 database_new < database.sql

Now you have received the utf8 character set database_new.