answersLogoWhite

0


Best Answer

You have to create two scripts, one for export and one for import. Data you get from database don't have to be in specific format, as long as you store whole information at all times.

You will have to make an export script, that basically SELECTs all the data of all tables you want to backup. Those data can be stored for example in a TXT file. It is very important that you save all the information about a data (e.g. from which table these data come from, what is the data context, and so on).

When you need to import data to a new database, you can read a TXT file, create a database structure using SQL function CREATE TABLE and then import read data using SQL command INSERT.

It's considered the best solution to encapsulate export and import features into functions.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you backup and restore mySQL Database using PHP scripts?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How you can take backup of database in mysql?

It is quite easy to back up a database using dbForge Studio for MySQL. To do this, open the tool and connect to the MySQL server. In the database explorer, right-click the database you want to back up and select Backup and Restore > Database Backup. Additionally, the tool allows you to automate the backup process using Task Scheduler.


What host do you use when your MySQL database is on a separate server to your PHP scripts?

For the host you need to put the IP address of the MySQL server instead of localhost.


What are some MYSQL backup methods?

Some of the methods for backups using the MYSQL method are to download programs specifically for ones needs like AutoMySQLBackup. To manually backup the database, the 'noupe' website offers information on how to do this.


How can i Have php post to self with mysql?

Mysql is an Database where Data from HTML forms will be inserted to it by some scripts like ASP 3 (classic), ASP.NET, PHP, ColdFusion and... What you need is a form (By HTML), an Database and table in Mysql and PHP to insert data from your form to the table. mysql insert command is: INSERT INTO table_name_here (column1, column2, ..) VALUES (value_of_column_1, value_of_column_2, ...)


How do you create a new database in MySQL?

The MySQL command is "CREATE DATABASE [dbname]" with "[dbname]" replaced with your desired database name.


What type of database is used in Friendster?

MYSQL database


What is MyISAM in MySQL?

MyISAM is the default table engine in the MySQL database.


What database does the WAMP server refer to when it?

WAMP stands for Windows Apache Mysql PHP. Mysql is the default database in WAMP


What is wikipedia's database website?

Wikipedia uses MySQL as its database.


How do you copy a database of mysql in wamp server from one computer to another?

You have several options: * copy the database files from mysql/data/<database_name> to a new mysql Installation * use mysqldump utility to export the data from your database and load it into the new mysql installation * setup replication


What company is the developer of the MySQL database?

The developer of the MySQL database software was MySQL AB, which was bought by Sun 2008 for one billion dollars. Oracle then acquire sun and hence MySQL and is currently responsible for the continuing development.


How do you put today's date into MySQL database?

Use: $todaysdate = date("d/m/y"); And then just send that to the MySQL database