MYSQL Import And Export Commands

. 5/26/10
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks



Export A MySQL Database


The easiest way to export is to use command prompt (cmd):


mysqldump -u username -p password database_name > filename.sql

You will be prompted for a password, type in the password for the username and press Enter. Replace username, password and database_name with your MySQL username, password and database name.


The file dbname.sql now holds a backup of your database and is ready for download to your computer.





Import A MySQL Database


To import database from dump file use:


mysql -u username -p password database_name < filename.sql

Note: The -p will prompt for your account's password.

0 comments: