well there are two ways that are preferable u can
mysqldump --all-databases -p > /path/to/location.sql
don't forget the .sql
or u can mysqlhotcopy
which has similar syntax but uses the --user= --password= argument format
mysqldump is better for innobd tables which are transactional
as a pose to the mysql default storage engine myisam which are non transactional tables u would use mysqlhotcopy for those
if u use the bash shell which u should =)
u can just mysq and tab over to see all the tools that come with mysql
now optimally u should use those tools but in the case of myisam tables u can CP and tar them like any other files as u should know the mysql database file are in
/var/lib/db/mysql
and if u were to have the databases help and me they would be like this
/var/lib/db/mysql/help
&
/var/lib/db/mysql/me
u just copy the .MYI .MDB and .frm files and u should be good
ofcourse they should be owned by mysql user
chown mysql.mysql *
and when u restore the files in this method they just appear in the mysql shell
when u restore from dump file u should get a query OK status message
sometimes the db's are in usr/local/
but u can just grep ps -aux for mysql to get the location of the DB files
so thats 3 ways to get a mysql back up
mysqldump is nice because it recreates every command that it takes to make ur DB,,, and when u restore from this it runs these commands and recreates the DB structure
mysqlhotcopy merges files with whats in memory so u can run it while the db is running,, u run mysqldump while db is running but the backup isn't as intelligent,,, somehow i always liked mysqldump its easier =)
i don't suggest copying the files without shutting down the DB either can corrupt dataZ mysqldump and hotcopy work on a live DB
and the dump format will be truly protable as it will use the type of sql statements most DB's use,, also it can be dumped in XML format and Comma delimeted text if u choose making it more portable