LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to restore mysqldump --all-databases backup (http://www.linuxquestions.org/questions/linux-server-73/how-to-restore-mysqldump-all-databases-backup-892922/)

ramecare 07-21-2011 06:04 AM

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,

minnarky 07-21-2011 07:54 AM

to restore them you need to use

--databases DB_NAME1 DB_NAME2 DB_NAME3

instead of --all-databases

ramecare 07-21-2011 08:14 AM

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

Blue_Ice 07-21-2011 09:42 AM

Quote:

Originally Posted by ramecare (Post 4421182)
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.

ramecare 07-25-2011 03:58 AM

Thank u very much,The above command is working for restore


All times are GMT -5. The time now is 02:00 PM.