Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (20.3k points)

I'm looking to be able to run a single query on a remote server in a scripted task.

For example, intuitively, I would imagine it would go something like:

mysql -uroot -p mydb_production "select * from users;"

1 Answer

0 votes
by (40.7k points)

Try the below query:

mysql -u <user> -p -e "select * from schema.table"

Related questions

0 votes
1 answer
0 votes
1 answer
asked Dec 30, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers


108k users

Browse Categories