backup_mysql_database_from_the_command_line
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
backup_mysql_database_from_the_command_line [2016/07/24 16:55] โ created walkeradmin | backup_mysql_database_from_the_command_line [2023/03/09 22:35] (current) โ external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
\\ | \\ | ||
\\ | \\ | ||
- | From the command line: | + | From the command line:\\ |
\\ | \\ | ||
First you must login to MySQL | First you must login to MySQL | ||
\\ | \\ | ||
+ | mysql -u root -p โ (the root part assumes root is your mysql username) | ||
\\ | \\ | ||
+ | A database backup is essentially a file that contains all the tables, fields and data from your database, stored in a text file. | ||
\\ | \\ | ||
+ | To perform a backup, use the following command line: | ||
+ | \\ | ||
+ | mysqldump database_name > database_name.sql | ||
+ | database name is the SQL database name (the output can be different) | ||
+ | | ||
+ | e.g. mysqldump gallery > gallery.sql | ||
+ | \\ | ||
+ | This command only backs up a single database, if you wish to do multiple databases then use: | ||
+ | \\ | ||
+ | mysqldump --databases database_one database_two > two_databases.sql | ||
+ | \\ | ||
+ | This allows the backup of many databases, in to one backup file. | ||
+ | \\ | ||
+ | \\ | ||
+ | You can backup all databases with this command: | ||
+ | \\ | ||
+ | mysqldump --all-databases > all_databases.sql | ||
+ | \\ | ||
+ | |||
+ |
backup_mysql_database_from_the_command_line.txt ยท Last modified: 2023/03/09 22:35 by 127.0.0.1