Ask Your Question
0

how to take backup of my sql and restore in fedora linux?

asked 2013-01-20 23:21:17 -0500

sunarc gravatar image

updated 2014-09-28 15:38:13 -0500

mether gravatar image

I am using fedora-5 linux as server and last few day It has booting problem. It shows an error related to "vol00/vol01" not found(not exact same) and "kernel penic". So I want to take full database backup and then restore the fedora in server. I used fedora bootable dvd and copy the all folders backup but I don't know how to restore in linux again. Please guide me with proper response. Thanks

edit retag flag offensive close merge delete

Comments

Please consider using a supported version of Fedora. If your application depends on older libraries than Fedora can provide, I recommend using a supported version of Centos.

randomuser gravatar imagerandomuser ( 2013-01-22 13:29:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-21 08:02:25 -0500

hhlp gravatar image

Back up From the Command Line (using mysqldump)

If you want to back up all the databases in the server at one time you should use the --all-databases option. It tells MySQL to dump all the databases it has in storage.

$ mysqldump -u root -p --all-databases > alldb_backup.sql

Back up your MySQL Database with Compress

If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup command below and pipe the output to gzip, then you will get the output as gzip file.

mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]

If you want to extract the .gz file, use the command below:

gunzip [backupfile.sql.gz]

Restoring your MySQL Database

you should follow two steps:

Create an appropriately named database on the target machine
Load the file using the mysql command:

mysql --user=root --password < backup.sql

To restore compressed backup files you can do the following:

gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

Backing Up and Restoring using PHPMyAdmin

It is assumed that you have phpMyAdmin installed since a lot of web service providers use it. To backup your MySQL database using PHPMyAdmin just follow a couple of steps:

Open phpMyAdmin.
Select your database by clicking the database name in the list on the left of the screen.
Click the Export link. This should bring up a new screen that says View dump of database (or something similar).
In the Export area, click the Select All link to choose all of the tables in your database.
In the SQL options area, click the right options.
Click on the Save as file option and the corresponding compression option and then click the 'Go' button. A dialog box should appear prompting you to save the file locally.

Restoring your database is easy as well as backing it up. Make the following:

Open phpMyAdmin.
Create an appropriately named database and select it by clicking the database name in the list on the left of the screen. If you would like to rewrite the backup over an existing database then click on the database name, select all the check boxes next to the table names and select Drop to delete all existing tables in the database.
Click the SQL link. This should bring up a new screen where you can either type in SQL commands, or upload your SQL file.
Use the browse button to find the database file.
Click Go button. This will upload the backup, execute the SQL commands and re-create your database.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-01-20 23:21:17 -0500

Seen: 3,258 times

Last updated: Jan 21 '13