Training

When: Every first Sunday of every month -get a ticket- from $15 (Click Here).

Tuesday, October 25, 2016

How to Back Up and Restore a MySQL Database

Back up From the Command Line (using mysqldump)


If you have shell or telnet access to your web server, you can backup
your MySQL data by using the mysqldump command. This command connects
to the MySQL server and creates an SQL dump file. The dump file contains
the SQL statements necessary to re-create the database. Here is the
proper syntax:


$ mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
  • [uname] Your database username
  • [pass] The password for your database (note there is no space between -p and the password)
  • [dbname] The name of your database
  • [backupfile.sql] The filename for your database backup
  • [--opt] The mysqldump option




How to Back Up and Restore a MySQL Database

No comments: