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

What does chmod do?

574


What is inside a seashell?

635


Differentiate between ‘ and ” quotes.

613


What is the default shell of solaris?

572


What is bash eval?

547






What are filters explain sort with all the options available?

932


How do I run a powershell script?

576


What are the different variables present in linux shell?

610


What is an inode block?

577


How to redirect both standard output and standard error to the same location?

632


Is shell scripting a language?

581


What is c in shell script?

637


What is the syntax of "nested if statement" in shell scripting?

629


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?

636


Why is it called a shell?

505