Menu
Latest Articles
- Make Apache listen on a different port
- XAMPP fails to start Apache 2 on Windows
- Remove Powered By text from RSMonials
- Joomla Zip Archiver
- Installing XDebug on XAMPP
- Joomla .htaccess - redirect non-www to www
- Remove Powered By text from JDownloads
- Joomla Custom PayPal IPN
- Using multiple databases within Joomla Framework
- Ajax Control Toolkit AsyncFileUpload - The file attached is invalid
MySQL CLI Backup/Restore |
![]() |
![]() |
![]() |
| Written by Alex Balyuk |
| Monday, 26 July 2010 13:22 |
|
Whether you are running some MySQL driven website, use MySQL database for various applications or experimenting with MySQL, it is EXTREMELY important to backup your data. Recently my development machine crashed, I am using version control system (Subversion I will briefly describe how to backup and restore MySQL database(s) with command line. This will work for Windows and Unix/Linux environments. Hope someone will find this information useful. BackupIn order to backup the database(s) do the following:
Examples of mysqldump command:All database on local machine Specific database on local machine Specific database on local machine All databases on remote machine Specific database on remote machine You can execute the dump command without specifying the password. Just do not specify the password as in example below, you will be prompted to enter the password. Benefit of this method is that password is not stored in history. More information on mysqldump can be found on MySQL Website
RestoreThere are several ways to restore the database(s) depending on the situation. Restoring database when it does not exist:Restoring to existing database:Restoring to local server Restoring to remote server Restoring to local server without specifying the password in the statement, password will be prompted More information on mysqlimport can be found on MySQL Website |
| Last Updated on Friday, 27 August 2010 13:39 |
is Free Software released under the GNU/GPL License.





Comments
Do you know how to ba[censored]up without specifying password?
Thx.
Here is example for dump:
mysqldump --user=USERNAME --password -A > /PATH/TO/BA[censored]UP.SQL
Executing the statement above will prompt you for password before ba[censored]up