Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

run a bash file to connect to remote server an execute an sql file

Posted on 2008-10-31
2
Medium Priority
?
847 Views
Last Modified: 2010-04-21
I need to be able to run a bash file to connect to remote server an execute an sql file
0
Comment
Question by:SaltyDawg
2 Comments
 
LVL 29

Accepted Solution

by:
fosiul01 earned 2000 total points
ID: 22853465
I guess its like this
#!/bin/bash

scp database.sql username@hostname:/databasedump/database.sql
ssh username@hostname:
mysql --user=mylogin --password=mypass MyDatabse < database.sql
0
 
LVL 1

Author Closing Comment

by:SaltyDawg
ID: 31512172
Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
Fine Tune your automatic Updates for Ubuntu / Debian
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question