Simple backup:
From one database, to a simple sql file.
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
Backup specific tables
One database, several specified tables, to a single sql file.
mysqldump -u [username] -p …
From one database, to a simple sql file.
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
One database, several specified tables, to a single sql file.
mysqldump -u [username] -p …
Want to check your database size?
SELECT table_schema "Database", sum( data_length + index_length ) / 1024 / 1024 "Size (MB)", sum( data_free )/ 1024 / 1024 "Free (MB)" FROM information_schema.TABLES GROUP BY table_schema ;
This will work in MySQL 5.0.2 and up. For older versions, use:
SHOW TABLE STATUS