MySQL: mysql dump > using to upload database
I recently created a website in PHP, with page details stored in a database using MySQL and then came acorss a problem when trying to upload it.
Basically mysqldump is a command that allows creates a file which contains all the sql statements required to rebuild the database or table you want. This is usefull for creating backups or allowing you to upload your database to your host server.
The command to do this is as follows
mysqldump –user=username –password=password databasename > locationofdump.sql
Note this should be entered in the normal command prompt, cmd.exe on windows, not the mysql command line tool thingy else it wont work. You can then use this to import the database on your host using phpmyadmin.
Comments