How can we take a backup of a mysql table and how can we
restore it. ?

Answers were Sorted based on User's Feedback



How can we take a backup of a mysql table and how can we restore it. ?..

Answer / ajay giri

We can use below query for exporting data to a .txt file.

mysql> SELECT * FROM <table_name> INTO
OUTFILE '<file_name>' FIELDS TERMINATED BY ',';

We can use below query for importing data from .txt file

mysql> LOAD DATA INFILE <file_name> INTO
TABLE '<table_name>'
FIELDS TERMINATED BY ',';

Is This Answer Correct ?    20 Yes 4 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / sekhar

backup of a table:
click on phpmyadmin -> open the database -> click on the
table -> click on export button -> give the file name ->
click on go button -> after that select the table create
statement and insert statement after that save the matter as
a text file.

Restore of a table:
click on phpmyadmin -> open the database ->click on import
button -> and select the file location -> and click on go
button.

Is This Answer Correct ?    16 Yes 2 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / jai thilak

MySQL provide an UI based tool called 'MySQL Administrator'.
This tool helps to take backup and restore backup.

Is This Answer Correct ?    14 Yes 3 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / esorimer

mysqldump dbname tablename > backup.sql
mysql dbname < backup.sql

Is This Answer Correct ?    8 Yes 2 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / kishore

mysqldump is an effective tool to backup MySQL database. It
creates a *.sql file with DROP table, CREATE table and
INSERT into sql-statements of the source database. To
restore the database, execute the *.sql file on destination
database.
Ex:
backup: # mysqldump -u root -p[root_password]
[database_name] > dumpfilename.sql

restore:# mysql -u root -p[root_password] [database_name] <
dumpfilename.sql

Is This Answer Correct ?    6 Yes 0 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / david

With dbForge Studio you can perform full database backup or restoring only selected database objects.
Database menu or from the shortcut menu of the database node of the Database Explorer window -> Backup Database -> Database Backup Wizard.
1. Select a database to back up, backup script file name and location, click the Next button.
2. Select Structure and Data, check Include all objects, click the Next button.
3. Set the backup options, click the Backup button.
4. Choose whether to open the backup script file in SQL Editor and wether to save the backup project for future use, and click the Finish button.

Backing Up Certain Database Objects
1. Choose a database to backup, script file name and location, click the Next button.
2. Select required information to backup.
3. Select database objects to backup their structure if you have chosen Structure or Data to backup on the Backup Content page, click the Next button.
4. Select tables to backup their data if you have chosen Data or Structure to backup on the Backup Content page, click the Next button.
5. Set backup options, click the Backup button.
6. Choose whether to open the backup script file in SQL Editor and wether to save the backup project for future use, and click the Finish button.

Restoring Database from Backup Script

To call Database Restore Wizard and restore the database from the backup script:
1. Select Restore Database... from the Database menu or from the shortcut menu of a database node of the Database Explorer window.
2. Select backup script file to restore and target database. If backup script file contains CREATE DATABASE statement, backup data will be restored to the created database instead of the selected database.
3. Check that the encoding for the restored file is selected correctly. The program automatically selects it basing on the restored file, if it fails, the default encoding (the current Windows encoding on the machine where dbForge Studio is running) is selected. You can always select a required encoding from the drop-down list.
4. Click the Restore button.

Is This Answer Correct ?    0 Yes 0 No

How can we take a backup of a mysql table and how can we restore it. ?..

Answer / vamsi krishna varma

Using XAMPP(its a package which include Apache Web
Server,Mysql Database to support a PHP file execution) we
have PHPMyAdmin tool which has Import,Export Option through
which we can create a backup of entire Database or an
individual table (Using Export Option) or we can also
include already existing backup in to our current database
(Using Import option).

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More PHP Interview Questions

How can we know that a session is started or not?

3 Answers   Rushmore Consultancy,


What are the special characters you need to escape in single-quoted stings?

0 Answers  


What and How possible injection in PHP and mysql?

3 Answers   RedAlkemi,


is php is the best for this situation

2 Answers  


Does php class need constructor?

0 Answers  






Can we use session in mvc?

0 Answers  


What is class extend in php?

0 Answers  


How to add comments in php?

0 Answers  


What is mean by RSS?How can i use this?

1 Answers   TCS,


Hello Friends,I am seeking for a job in php having 2yrs. exp.Please suggest any company openings.

1 Answers  


Where do we use get and post?

0 Answers  


How could I install codeignitor ?

0 Answers  


Categories