How to dump ?
file that contains the contents of a database - this is the database dump.With it is possible to recover from scratch.In fact, it is simply a copy.But why did not call, a copy of the database.
database storage occurs in different files.It depends on the type of operating system, version of the database management system, and others. Therefore, quite difficult to find all files in the system database, and a transfer to another system.Dump just serves to facilitate this task.
dump Why endure the database?
- to create backups before making major changes in the structure of the site.For example, a third-party component has been installed as a result of the site became unusable and require rapid restoration of its work.Here is used the emergency database dump.
- site is usually first done on the local machine under Virtual Server, and then he was transferred to the hosting.And if the files question is more or less clear, that database migration question is not so obviously solvable.Here again you will need a database dump.
How to use the dump.We consider the standard for web programming task you want to migrate a site created on the local machine hosting.How to transfer MySql database?There is a utility phpMyAdmin.It is, as a rule, should be established provider in the Denver and it must go.Take advantage of it can be directly in the browser, because it is written in php.
- have to go in your browser to phpMyAdmin page for the required database.
- On the next page, enter the Export tab.
- Select the required parameters.If you check "Add DROP DATABASE", then the dump return back to the server will be the following: if a server already exists a database with the same name, you must first remove it, and then exported is created.
- Put file compression using archiver to reduce the volume of the downloaded file.
- If all observed correctly, you have to press OK.
- After some time a window will appear prompting you to download a database dump.
- base for exporting data to a new hosting service, it is necessary to go to the Import tab, select the resulting dump file and click OK.
In case of a successful operation, a message appears stating that the database export was successful.Otherwise, the bottom of the error message appears.
It consists in importing a database from the command line.
- At the command prompt, enter: mysqdump my database - -user = username -password & gt; = my password & gt;my_dump.sql
- appears database file.Dump ready.
- To restore the database from a dump it is necessary to execute: Mysql -u username -p database
reading this article, you can find out yourself how to do dump.