Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:31:51+00:00 2026-06-12T10:31:51+00:00

I need to script a mysql restore of a linux machine from a windows

  • 0

I need to script a mysql restore of a linux machine from a windows machine. I have putty and I know it has ssh capability. Here is what I have:

C:\Progra~1\Putty\putty.exe -ssh root@10.1.2.3 && mysql -u USER -pPASS db < /tmp/dump.sql

My problem in writing a script is that putty opens a new window and transfers control there, so anything coming after

putty.exe -ssh 

doesn’t do anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:31:53+00:00Added an answer on June 12, 2026 at 10:31 am

    You can use the -m option to specify a file which contains a command to run on the remote connection.

    Example:

    C:\Progra~1\Putty\putty.exe -ssh -m C:\cmd.txt root@10.1.2.3
    

    Contents of C:\cmd.txt

     mysql -u USER -pPASS db < /tmp/dump.sql
    

    From the Putty Documentation:

    3.8.3.6 `-m’: read a remote command or script from a file

    The -m' option performs a similar function to theRemote command’
    box in the SSH panel of the PuTTY configuration box (see section
    4.18.1). However, the `-m’ option expects to be given a local file name, and it will read a command from that file.

    With some servers (particularly Unix systems), you can even put
    multiple lines in this file and execute more than one command in
    sequence, or a whole shell script; but this is arguably an abuse, and
    cannot be expected to work on all servers. In particular, it is known
    not to work with certain `embedded’ servers, such as Cisco routers.

    This option is not available in the file transfer tools PSCP and
    PSFTP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help in converting my script from using mysql to mysqli I
I have an insert script with mySQL. I need to place the date and
I need to be able to write a script to automatically connect mysql in
I need a script to copy only the changed/modified and new files from my
Ok, here's an easy one: I have a table in MySQL where I keep
At work we have a script that does a mysql data dump everynight. For
I need mysql script (not a stored procedure) that check whether column exist or
I am tring to make the google news sitemap by php script from mysql.(all
Guys, I have a python script which builds up a MySQL table with timestamps
I have written a script which takes mysql dumps and uploads it to s3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.