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

To run php script on a local machine we need to install Apache http server and php. Then only scripts are run in the browsers. but when these things are not loaded on a local machine and a php script is brought by the browser still the browser displays the page. how?

2 Answers  


How to Define a Constant in PHP? Is $ symbol necessary?

6 Answers   Maples,


how to get substring of string without using substr() function in php ????

3 Answers  


Is php an array?

0 Answers  


Can I use node js with php?

0 Answers  






Which of the following represents the proper way to set a session variable? Answer: a. $_SESSION['foo'] = 'bar'; b. session_start(); c. session_set_save_handler ('myopen', 'myclose', 'myread', 'mywrite', 'mydelete', 'mygarbage'); d. $foo = $_SESSION['foo']; 2.When administering MySQL, you should make the data directory accessible via the operating system 3.which statement can be used to determine how the optimizer resolves a query

9 Answers   Cybercom, TCS,


What are the 3 types of sessions?

0 Answers  


Is key exist in array php?

0 Answers  


Why is used in php?

0 Answers  


What are the three classes of errors that can occur in php?

0 Answers  


Is null function in php?

0 Answers  


How do you destroy a particular or all Sessions?

0 Answers  


Categories