I wanted to store my databases on SD so I created the directory 'mysql' on sd.
CODE
mkdir /mnt/card/mysql
To tell MySQL that the database storage area is in this new directory, edit the file /etc/mysql/my.cnf and comment out the old 'datadir' line and add a new one.
CODE
datadir = /mnt/card/mysql
#datadir = /var/lib/mysql
#datadir = /var/lib/mysql
Go to the /mnt/card/mysql directory. All databases are stored in this directory as subdirectories. You need to set up the 'mysql' control database here too and copy the contents from the original install location. The tables in this database control the actual running of MySQL. You have to change the ownership of the new directories to the userid & group of 'daemon'.
CODE
cd /mnt/card/mysql
mkdir mysql
cp /var/lib/mysql/mysql/* mysql/
cd .. <== this should put you at /mnt/card
chown -R daemon:daemon mysql/
mkdir mysql
cp /var/lib/mysql/mysql/* mysql/
cd .. <== this should put you at /mnt/card
chown -R daemon:daemon mysql/
As root, start the database management system:
CODE
mysqlstart
Any messages should go to /var/log/mysql.err
To stop the database management system:
CODE
mysqlstop