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 a scripting language simple definition?

0 Answers  


what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?

1 Answers  


How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.

5 Answers   Wells Fargo,


What is the conditional statement in shell scripting?

0 Answers  


HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?

3 Answers   Patni,






What is the difference between grep and egrep?

0 Answers  


What is the command for " how many shell is running in your system or how many shell supported by your system " ?.

3 Answers  


How do I run a script from command prompt?

0 Answers  


how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?

4 Answers  


What is difference between bash and shell?

0 Answers  


what is the difference between cmp and diff commands

2 Answers   Amazon, CTS,


How do I open the shell in cmd?

0 Answers  


Categories