Home arrow Applications Tips arrow Backup a MySQL Database
Backup a MySQL Database PDF
Sunday, 01 June 2008
This tutorials shows you howto backup/ restore a MySQL Database. You will need to have shell access to your mysql server or to be able to connect remotely using mysql client to your mysql server.

1. Backup your MySQL Database

#mysqldump mydatabase -p > file.sql


2. Restore your MySQL Database

#mysql -u username -p
mysql> create database mydatabase;
mysql> use mydatabase;
mysql> \. file.sql


First go to your mysql client then type \. file.sql
You should be in the same directory as your file.sql file. If not, then use file.sql with absolute path to it. (for example if your file is located in /home/john/database, and the file name is file.sql, then the yo shoud use instead of file.sql, /home/john/database/file.sql

Last Updated ( Sunday, 05 February 2012 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?