How Connect to a Database in Shell Programming?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I start a shell script?

561


I have 2 files and I want to print the records which are common to both.

685


What is k shell?

527


How to get script name inside a script?

536


Is bash an operating system?

535






Determine the output of the following command: name=shubham && echo ‘my name is $name’.

520


What is a command line shell?

561


What is the first line of a shell script called?

565


Is bash a shell script?

591


Why is it called a shell?

497


What are types of shells?

535


What is difference between shell and bash scripting?

532


What is the fastest scripting language?

543


What is shell geeksforgeeks?

584


What are the different variables present in linux shell?

603