Running MySQL script on remote computer.

Is there any way to run a MySQL script located on a local machine on another computer located on the same network given that you already know the ip address, port number, MySQL username and password, and the database name. I am investigating trying to send the file across the network, but have not found a solution that works.

Sure, provided you have set up a server to accept those scripts and run them. In general you can't just run executable code on somebody else's computer without having a server and permissions set up in advance; I'm sure you can see why if you think of the word "security".

Similar Messages

  • "Device Manager is running in read-only mode because you are running it on a remote computer" when local

    Hello - since configuring a Windows Web Server 2008 R2 x64 to be hardened for an internet-facing deployment I receive this:
    "Device Manager is running in read-only mode because you are running it on a remote computer."
    when entering Device Manager.
    I have tried reversing the changes I have made, such as:
    - Re-adding Client for Microsoft Networks
    - Re-enabling NetBIOS over TCP-IP
    - Re-adding File and Printer Sharing
    - Disabling the Windows Firewall in all profiles (public, domain, private)
    I get no joy. It looks like a Microsoft ballsup. I'll try and use Process Monitor to have a look. Google returns only 1 page for this error.
    Luke

    Got it.
    After my changes to DHCP and static IPs the machine picked up the IP address of another server on my little home LAN. The hostname in IPCONFIG was different to the actual server computer name and so this led Device Manager to think the connection and the
    local machine were different.
    What an odd and infuriating problem. My thoughts on this are that Microsoft should be more verbose with error messages and their causes. For example, displaying the values of the assertion would help diagnose a problem; "The host-name www02.farm.brand.com
    that you are connecting from does not match the local host-name rest01.dev.farm.brand.com. Connections from remote computers can only use Device Manager in read-only mode; some options will be disabled."
    When troubleshooting, the main thing on an engineer's mind is "what has led Windows to its [unexpected] conclusion?"
    Luke

  • C# Run VB Script file remotely thriugh PowerShell Invoke Command

    I have a requirement where need to run vbscript remotely through PowerShell Invoke command. I can run the VB Script locally but not remotely as the vbscript file is not present on the remote machine. I don't want to copy the script file on remote machine.
    Please let me know how to run vb script on remote machine. Below is the code.
    Collection<PSObject> output
    = null;
            using
    (Runspace runSpace =
    RunspaceFactory.CreateRunspace())
                runSpace.Open();
                using
    (Pipeline pipeline = runSpace.CreatePipeline())
    RunspaceInvoke invoke =
    new RunspaceInvoke();
    PowerShell ps = PowerShell.Create();
                    ps.Runspace
    = runSpace;
                    ps.AddCommand("invoke-command");
                    ps.AddParameter("ComputerName",
    "RemoteServerName");
    ScriptBlock sb = ScriptBlock.Create("cscript E:\\Test\\DeleteFiles.vbs");
                    ps.AddParameter("ScriptBlock", sb);
                    output
    = ps.Invoke();
    Regards, Parveen

    Hello Parveen,
    Please refer to the following thread
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/7562eefb-7fba-4bf6-834e-82256f159155/run-script-on-remote-macine?forum=csharpgeneral
    See his code:
    You can use WMI to create processes on a remote machine. In C#, use the ManagementClass.
    using System;
    using System.Management;
    using System.Collections.Generic;
    public class MyClass
    public static void RunNotepad()
    ManagementPath p = new ManagementPath(@"\\targetMachine\root\cimv2:Win32_process");
    ManagementClass m = new ManagementClass(p);
    m.InvokeMethod("Create", new Object[] {"notepad.exe"});
    See: Creating Processes Remotely
    Note that the the scrpt file is not executable so you have to create script like this:
     cscript.exe "\\yourmachine\script\test.vbs".
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Powershell Script, Control Remote Computer's Speaker Volume

    how are you getting the function to the remote session?

    I'd like to be able to control the volume of a remote computer's speakers and I'm having some trouble. I found a function that works perfectly, but it doesn't work remotely. This may just be a limitation of sendkeys.http://stackoverflow.com/questions/22083674/calling-a-function-within-a-function-with-invoke-command...So I've tried to use this in a couple ways. I've been able to send functions through before as a whole script block, but I'm having no success with this.This is the format that normally works for me
    Invoke-Command -ScriptBlock ${Function:Set-Speaker} -Argumentlist $intVolume -ComputerName $strComputerI've also tried to do this through Enter-PSSession and dump the whole function in and run it, it doesn't work. I'm not getting any errors.When I run the same thing on a local session on that pc, it has no problems. Let me know...
    This topic first appeared in the Spiceworks Community

  • Executing powershell script from remote computer using RSAT

    Hi.
    I want to execute powershell script on AD server from remote computer (in the same domain). I installed and tested RSAT - it is working fine. But i cant execute PS from c# code.
    ps.Commands.AddCommand("Import-Module").AddArgument("ActiveDirectory");
    ps.Invoke();
    ps.Commands.AddCommand("Get-ADOrganizationalUnit -Filter 'Name -like \"*\"'");
    var res = ps.Invoke();
     And i get exception:
    An unhandled exception of type 'System.Management.Automation.CommandNotFoundException' occurred in System.Management.Automation.dll
    Additional information: The term 'Get-SBNamespace' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    Hi
    CapitanPlanet
    For the
    CommandNotFoundException, it means the command cannot be found.
    On the other hand, your issue is about the PowerShell, if you still have the issue, I suggest that you should post it in the
    PowerShell forum for efficient response.
    Here are some useful information, please check
      Powershell
    commands from C# not working (System.Management.Automation.CommandNotFoundException)
    Powershell, Service Bus For Windows Server Programmatically: Command found, module could not be loaded
    https://msdn.microsoft.com/en-us/library/dn282152.aspx
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Running .exe file on remote computer using SQL server Agent JOb

    I am trying to run exec file on a remote server by using sql server Agent job, 
    what is the best way to do this
    k

    Configure it as an operating system job step:
    http://technet.microsoft.com/en-us/library/ms190264.aspx
    Alternate: build an SSIS package and schedule it as a job.
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Run perl script on remote server

    Hello
    I have 2 servers, server 1 and server2.
    I have a perl script on server2 and I want to execute that perl script so my code is like
    $command= { param($p1,$p2) cmd /c test.pl $p1 $p2 }
    Invoke-Command -session $sesion -ScriptBlock $command -ArgumentList 1,2
    session is already created with server2 from server1. 
    perl script kept on server2 spawn another cmd which interacts with server3.
    When I run above code that perl script start executing but it stays in executing step for infinite time..as per observation, I have found that it stucks when it tried to spawn another cmd which interacts with server3 from server2.
    How can I handle this?

    Second hop restriction and some issue in the perl script that prevents it from honoring the error.
    Run script interactively to test results.
    Enter-PsSession $session
    Type your command and see if you see an error.
    \_(ツ)_/

  • Run batch file on a remote computer

    I am looking for syntax so that I can run a batch file that is on my computer and I want to run it on a remote computer. I am thinking I can do this with psexec but have not been able to figure out the correct syntax.

    psexec.exe -s \\namepc -u yourusername -p yourpassword cmd /k c:\blabla\Install.bat
    Install.bat must be on some folder on remote pc and I think that is only posible way.
    U can change \\namepc with @blabla.txt file with computers list if you want to run that bat file on more computers.
    Your account in this example must have admin rights on remote computer.

  • Issue with running powershell script in pssessions

    Hi Everyone,
    I am trying to run powershell script from remote machine using below commands
    C:\Users\user>"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
    -command "$s= New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
    http://Exchservername/PowerShell/ -Authentication Kerberos ; Import-PSsession $s; "C:\Failback.ps1"
    and Below is the failback.ps1.
    $mbxs = Get-MailboxDatabase | Sort Name
    ForEach($mbx in $mbxs)
    $MBdb=$mbx.Name $ServerHosting=$mbx.Server.Name
    if($mbx.activationPreference.value -eq 1)
    If ($ServerHosting -ne $ActivationPreference.Key.Name) 
    Move-ActiveMailboxDatabase $MBdb -ActivateOnServer $ActivationPreference.Key.Name -confirm:$False 
    Below is what i am getting.

    What is your question?  Are you pointing out the yellow text?  This is normal, and appears every time EMS is opened.
    I should also point out that Microsoft provides a script to re-balance databases, if that's what you're trying to accomplish:
    You can use the RedistributeActiveDatabases.ps1 script to balance the active mailbox databases copies across a DAG. This script moves databases between their copies in an attempt to have an equal number of mounted databases on each server in DAG. If required,
    the script also attempts to balance active databases across sites.
    https://technet.microsoft.com/en-us/library/dd335158(v=exchg.141).aspx
    Mike Crowley | MVP
    My Blog --
    Baseline Technologies

  • Assistance with my script to find all opened windows (applications running) on remote computer

    Hello,
    I have the following script whereby I want to list all the running (opened) applications on a remote computer.  It's a shared computer between two people who use the same generic ID.  Before one RDP's into it, I thought it would be interesting
    to see if any apps are opened before logging in. 
    Here is the code:
    $cred = Get-Credential
    Invoke-Command -ComputerName server123 {Get-Process *mail* | Where {$_.MainWindowHandle} | Select Name,MainWindowTitle} -Cred $cred
    It works in that it asks for my credentials and runs without any error...but this script also does not display any running applications. I'm not sure what it should show. Perhaps I need to add a line of code to display what it found?
    Another bit of info I would like to use in this script is to also confirm that the generic ID is logged in at the time I run this script.  I could use the following bit of code:
    get-wmiobject Win32_ComputerSystem -computername server123 | format-table -property username
    But when I run this code I get an access denied message. I'm assuming I need to use the Get-Credential again from my first script, but I'm unsure how to use it in the get-wmiobject?
    Any help you can provide would be greatly appreciated.
    Thank you.

    Ok...shifting gears again.  Instead of running this remotely I'm thinking of running a scheduled task on the server and creating this .htm file.  That way no one has to run and enter in credentials (and if entered wrong cause issues with locking
    out the account).  So, I've modified my script and confirmed that when I run it from Powershell when logged into the server, the results file correctly shows the logged in userid and the running applications (windows) I have opened. 
    But, when I run this same exact script from my task scheduler, the running applications piece is blank?  The server I'm running this on is Windows Server 2008.  I've tried running it from Task Scheduler using Powershell and from a .bat file that
    calls my Powershell script.  Both ways results in my .htm file not showing any applications running.  Yet when I run the same script (either from Powershell or the .bat file) the .htm file correctly shows the running applications.  My Task Scheduler
    Job is using the same user id that I'm logged in with so there shouldn't be any permission issues with running from the task scheduler.
    Here is my code:
    $a = "<style>"
    $a = $a + "BODY{background-color:peachpuff;}"
    $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
    $a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
    $a = $a + "</style>"
    get-wmiobject Win32_ComputerSystem | ConvertTo-HTML -head $a -body "<H2>Logged in UserID</H2>" -property username | Out-File C:\Powershell_Scripts\Test.htm ; Get-Process |where {$_.mainWindowTItle} |Select-Object name,mainwindowtitle | ConvertTo-HTML -head $a -body "<H2>Open Applications</H2>" | Out-File C:\Powershell_Scripts\Test.htm -Append
    Can anyone tell me what might be the reason for the script running from the scheduled task having issues?
    Thank you.

  • Run script in other computer.

    Hello,
    I have already scenarios with scripts.
    All the script right now locates in the xi server.
    I'm looking for the way to run script in other computer then XI server.
    Thank you
    Elad

    Hi,
    What OS are your servers running ? UX, a rsh-like would be the most obvious solution (or a more secured remote feature, ask your admins about that) ... For windows, I know there is a sysinternal tool that allows you to invoke scripts remotely ...
    Rgds
    Chris

  • How to Prompt for User/Pass Running Shell Script Remotely through ARD

    So I finally got my Active Directory Script working! However, I realized that I'm not the only one going to be running this script and to have my user name and password in the script itself is beyond foolish. While I know it's possible just to have whoever's running the script to manually add their username and password, I'd prefer to have prompts to make things easier for the rest of my team.
    Here's my current script. I've tested it on the machine I'm connecting to Active Directory and it works fine if you run it on the machine itself in terminal. However, I'm going to be doing this on about 150 machines and the whole point of the script is to do it remotely.
    #! /bin/bash
    MACNAME=$(scutil --get ComputerName)
    read -p "User Name: " USER
    read -p "Password for $USER: " PASS
    dsconfigad -add "CORP.DOMAIN.NET" \
    -username $USER \
    -password $PASS \
    -computer $MACNAME \
    -mobile disable \
    -mobileconfirm disable \
    -localhome enable \
    -useuncpath enable \
    -shell /bin/bash \
    -ou OU=Macs,CN=Computers,DC=corp,DC=DOMAIN,DC=net \
    -force \
    -localpassword "PASSWORD" \
    -groups "GROUPS"
    When I run the UNIX script through ARD to a machine, I get no prompts for USER or PASS. In fact, it gives me the following error "dsconfigad: Authentication server encountered an error while attempting the requested operation. (5202)" So it's not asking for a user name and password.
    Is there any way to make a shell script prompt you for a User Name and Password when you're sending commands remotely through ARD? Or is there another way to do this?
    Any suggestions would be greatly appreciated.
    -rks

    Best solution is to create an account that is exclusive to binding machines.  By doing this, you can embed the user name and password in the script.  Heck, you can post it on your website.  If the account is configured properly, it will only be able to create machine records in a defined container.  If you are mixing Macs and PCs in your AD domain, I also recommend creating an isolated container for your Mac records.  Now, the account has even less access rights as you can make it so it only has rights to the Mac container.
    Otherwise, ARD does not prompt.  You can play around with an expect script but the reality is that you are still embedding the credentials in the script so it really does not achieve what you want.  ARD is not an interactive shell scripting tool.  It is more a fire and forget.
    Reid
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

  • How do i run a vi on a remote computer in a network

    on one computer(using Labview 6i)i have a vi that acquires data from "lab-pc+" board.now i want to run this vi on another computer(using labview 6i) in the network,but this computer does not have the "lab-pc+" board.how do i do this
    thanks shri

    VI server will allow you to execute a VI that resides on a remote machine from a LV application that is local.
    The only restrictions are fire-walls and speed.
    I have used this technique to allow supervisor personal to monitor and control factory applications from there laptop.
    Look into "VI Server" and "call by reference".
    FYI: This list (LabVIEW Real-Time) is set aside for questions involving the RT version of LV. You will get a larger audience if you post any follow-up question to the LV general list.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Run ARD administrer from a remote computer

    Sorry if this has been answered previously; searching with terms like remote and administrator doesn't restrict many responses.
    I have installed ARD on one of my Leopard Servers and I would like run it from my desktop computer as I do the server applications. Is this possible or do I have to be sitting at the server run ARD? I have checked through the Administrators Guide but can't find anything about this but it seem like a natural thing to want to do
    Thanks for any assistance.
    Bill

    If you don't need to run ARD from your workstation, you could have just the single copy of ARD on the server and take control of that via 10.5 screen sharing (that should still work with the ARD admin app running on the server, though I've never tried it) or VNC. Then you wouldn't need two copies of ARD. If you want ARD on your workstation as well, though, then you will need to purchase a second copy of ARD if you don't have two copies now.

  • How do I send a command to run a program on a remote computer

    I am trying to use the TCP vi's to send a command to a remote computer on our local area network, so that a program runs on that remote computer. How do I do this, if possible?

    Set one server VI on the remote computer to LISTEN (create listener / wait on listener) continuously for one port. When it receive something, READ the string and see if it is the one that you are expecting. On your computer, set a client VI, which first CONNECT (open connection) to the remote computer (using remote's IP and port number) and then it SENDs a string containing the command.
    Hope it helps.
    p.s.: Uppercase words name the Vis that you should use for this application.

Maybe you are looking for