Can we back up mysql databases by copying files?
If you are able to shut your database server down (and my understanding is that you are indeed able to) - thereby disabling your application - then that's the easiest indeed.

You can, after shutdown, just copy+paste your data directory. Where is your data in the first place? Just issue:

SELECT @@datadir;


From within your MySQL server.

By the way, while you must backup your data someplace safe, I do not expect any of the apt-get or aptitude commands to actually touch your data.

NOTE that the page you've linked to has some pretty crazy ideas, like:

[!!DO NOT DO THIS!!] find / -iname ‘mysql*’ -exec rm -rf {} \;


I encourage you to look someplace else, given the above query. It will remove any and all mysql* file from your root filesystem. Including your own application's mysql-config.ini files (if any, of course), including libdbd-perl-mysql -- without clean uninstall... I mean, this is really BAD advice.

There's no point in backing up your my.cnf file, delete the file then put it back again. The same holds for your datadir.

Just uninstall MySQL and re-install is enough -- but that, too, is kinda funny, since both are done via apt-get -- so you basically reinstall the same version... At least get yourself newer version of MySQL.