Which two commands will restore the sakila database without interfering with other running database?

Mysqldump was used to create a single schema backup;
Shell> mysqldump –u root –p sakila > sakila2013.sql
Which two commands will restore the sakila database without interfering with other running
database?

Mysqldump was used to create a single schema backup;
Shell> mysqldump –u root –p sakila > sakila2013.sql
Which two commands will restore the sakila database without interfering with other running
database?

A.
Mysql> USE sakila; LOAD DATA INFILE ‘sakila2013.sql’;

B.
Shell> mysql –u root –p sakila sakila2013.sql

C.
Shell> mysql import –u root –p sakila sakila2013.sql

D.
Shell> mysql –u root -p –e ‘use sakila; source sakila2013.sql’

E.
Shell> mysql –u root –p –silent < sakila2013.sql

Explanation:
Reference: http://mysql.livejournal.com/133572.html



Leave a Reply 26

Your email address will not be published. Required fields are marked *


wolfsrudel

wolfsrudel

Incomplete and wrong.

D, E.

ispanico

ispanico

D is sure
And why not B?
In B is missing < or in E -silent is sakila. What is -silent? I don't know

wolfsrudel

wolfsrudel

In B “<" is missing.

-s, –silent Be more silent. Print results with a tab as separator,
each row on new line

ispanico

ispanico

ok -s, not -silent
anywhere database name is also missing in E!

ispanico

ispanico

Ok I’m sorry
-s or –silent with double minus, is an option that I didn’t know …
Anyway as I write above, database name is missing so
in B is missing “<"
in E is missing database name
What is the correct answer?

Eduardo

Eduardo

What is the corret answer?

mysql_user

mysql_user

E is still correct even without the database name.
D&E are the answers.

vithiyan

vithiyan

we can’t use E,
ERROR 1046 (3D000) at line 22: No database selected

we will get above error

Jose Wilson

Jose Wilson

Should be C and D

Me

Me

only D, checked.

Bony

Bony

I take exam at February 26th 2015, on exam writed :

C. mysql -u root -p sakila < sakila2013.sql

so the correct answer is B and C

vasben

vasben

B and C?
Did you mean D and D?

vasben

vasben

Sorry, did you mean B and D?

Bony

Bony

Sorry, I mean the correct answer is B and C

On the exam B writed :
Shell> mysql -u root -p sakila mysqlimport -u root -p sakila sakila2013.sql

But on personal trial, answer C, must change the sakila2013.sql with table name.

Bony

Bony

Sorry, I mean the correct answer is B and C

On the exam writed:

B. Shell> mysql -u root -p sakila mysqlimport u root p sakila sakila2013.sql

But on personal trial, on answer c the sakila2013 must be change with table name

Steve

Steve

It is B and D

D is using execute option to perform SQL statements.
Source is equivalent.

E

E

C and D

But “<" is missing in C.

Steve

Steve

C would be correct if the whitespace between mysql and import is wrong.
Mysqlimport does not require the < before the filename.

D is obviously correct.

Bony

Bony

D isn’t correct.
you will see this if you using D.

C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysql -u root -p ‘use universtas;source uni2015.sql’
mysql Ver 14.14 Distrib 5.6.23, for Win32 (x86)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Usage: mysql [OPTIONS] [database]
-?, –help Display this help and exit.
-I, –help Synonym for -?
–auto-rehash Enable automatic rehashing. One doesn’t need to use
‘rehash’ to get table and field completion, but startup
and reconnecting may take a longer time. Disable with
–disable-auto-rehash.
(Defaults to on; use –skip-auto-rehash to disable.)
-A, –no-auto-rehash
No automatic rehashing. One has to use ‘rehash’ to get
table and field completion. This gives a quicker start of
mysql and disables rehashing on reconnect.
–auto-vertical-output
Automatically switch to vertical output mode if the
result is wider than the terminal width.
-B, –batch Don’t use history file. Disable interactive behavior.
(Enables –silent.)
–bind-address=name IP address to bind to.
–character-sets-dir=name
Directory for character set files.
–column-type-info Display column type information.
-c, –comments Preserve comments. Send comments to the server. The
default is –skip-comments (discard comments), enable
with –comments.
default-auth (No default value)
histignore (No default value)
binary-mode FALSE
connect-expired-password FALSE

C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>

LnL

LnL

You need the -e for execute for D to be correct.

The correct answer is C and D.

Bony

Bony

IF Answer E, you will get this error :

C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysql -u root -p -silent mysql -u root -p -s mysqlimport -u root -p univers
itas uni2015.sql
Enter password: ********
mysqlimport: Error: 1146, Table ‘universitas.uni2015’ doesn’t exist, when using
table: uni2015

Steve

Steve

The way the answers are written, D is the only correct answer.
There are obviously typos.

The closest second answer is B; but it is missing the < between the database and dum file.

dash-68

dash-68

B & D are the right answer, both tested, there is a missing “<" in answer B between the database name and the dump file

sakthi sri

sakthi sri

B & D perfect…*

Going to

Going to

I am in fact happy to read this web site posts which carries tons of helpful data, thanks for providing these information.|