How Connect to a Database in Shell Programming?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the syntax for "if" conditionals in linux?

585


What is bash command used for?

572


How to print all array elements and their respective indexes?

499


What is shell prompt?

556


What is bash coding?

490






Is shell a scripting language?

561


What is $1 in shell scripting?

579


What is a shell made of?

551


Print the 10th line without using tail and head command.

1660


How do I edit a .sh file?

613


What can scripts do?

657


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

632


What are the different variables present in linux shell?

603


What is k shell?

527


How do I open the shell in cmd?

519