How Connect to a Database in Shell Programming?

Answers were Sorted based on User's Feedback



How Connect to a Database in Shell Programming?..

Answer / ashu

you have a "sqlplus" command to connect to database.

command is as follows:

sqlplus <db_username>/<db_password> @test.sql

Is This Answer Correct ?    19 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / sibin kc

You can simply use as follows.

mysql -h <hostname> -u <user name> -p<password> -e "use
psa;select * from domains where domain_name = 'hai.com';"

Is This Answer Correct ?    9 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / seshadri sethi

(1)1st give "sqlplus"
(2)then it will show "sqlplus" prompt
(3)give "db username"
(4)give "db password"

Is This Answer Correct ?    8 Yes 6 No

How Connect to a Database in Shell Programming?..

Answer / supraja

mysql -uusername -ppassword -hipaddress database -e "statement"

eg:mysql -uroot -psuppu -h192.168.0.1 supraja -e "select
count(*) from table"

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What is inside a seashell?

0 Answers  


What is the default ubuntu terminal?

0 Answers  


What is the best scripting language?

0 Answers  


What are the various stages of a linux process it passes through?

0 Answers  


What is shell prompt?

0 Answers  






How to find all the files modified in less than 3 days and save the record in a text file?

0 Answers  


What are script files?

0 Answers  


Given a file find the count of lines containing the word "abc".

0 Answers  


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

0 Answers  


What is the difference between a variable and value?

7 Answers   Sun Microsystems,


What is a batch file used for?

0 Answers  


What are scripts in psychology?

0 Answers  


Categories