LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 07-21-2011, 06:04 AM   #1
ramecare
Member
 
Registered: Feb 2011
Posts: 176

Rep: Reputation: 0
How to restore mysqldump --all-databases backup


Dear all,

Iam trying to take all datbases backup using the below command

mysqldump -u root -pecare2@ --all-databases > alldatabases.sql

The above given command was working fine without any problem.The problem is i

was not able to restore all the databases.Iam using the below command to restore

all the databases.

mysql -u root -pecare2@ --all-databases < alldatabases.sql

But,when i execute this command iam getting the below give error .

[root@itsupport ~]# mysql -u root -pecare2@ --all-databases < alldatabases.sql
mysql: unknown option '--all-databases'

Can any one help me on the command how to restore all database

Thanks in advance,

Last edited by ramecare; 07-21-2011 at 06:05 AM.
 
Old 07-21-2011, 07:54 AM   #2
minnarky
LQ Newbie
 
Registered: Nov 2010
Location: MN
Distribution: Fedora and RHEL
Posts: 20

Rep: Reputation: 2
to restore them you need to use

--databases DB_NAME1 DB_NAME2 DB_NAME3

instead of --all-databases
 
Old 07-21-2011, 08:14 AM   #3
ramecare
Member
 
Registered: Feb 2011
Posts: 176

Original Poster
Rep: Reputation: 0
I used the above command iam getting the below same error

[root@itsupport ~]# mysql -u root -pecare2@ --databases networkinfo systeminfo > alldatabases.sql
mysql: unknown option '--databases'

Thanks
 
Old 07-21-2011, 09:42 AM   #4
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 352

Rep: Reputation: Disabled
Quote:
Originally Posted by ramecare View Post
I used the above command iam getting the below same error

[root@itsupport ~]# mysql -u root -pecare2@ --databases networkinfo systeminfo > alldatabases.sql
mysql: unknown option '--databases'

Thanks
That's because that switch doesn't exist with the mysql command.

Code:
mysql -uroot -pecare2@ < alldatabases.sql
For this command the databases need to exist or the alldatabases.sql script needs to contain the CREATE DATABASE queries for the databases.
 
Old 07-25-2011, 03:58 AM   #5
ramecare
Member
 
Registered: Feb 2011
Posts: 176

Original Poster
Rep: Reputation: 0
Thank u very much,The above command is working for restore
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysqldump help on multiple databases sir-lancealot Linux - Server 2 03-10-2011 11:04 PM
Restore a big mysqldump turiyain Linux - Server 4 06-05-2010 08:52 AM
Backup and restore ldap databases gimmereeson Linux - Server 7 02-26-2008 07:46 AM
Need to restore databases! newuser455 Linux - Software 5 04-19-2006 12:02 PM
restore using mysqldump sporkit Linux - Networking 2 05-26-2004 05:34 PM


All times are GMT -5. The time now is 12:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration