Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
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 -hslavedb.mydomain.com 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

Browse Categories

...