开发者

taskkill Mysql from .ASPX -- Permission Problems?

开发者 https://www.devze.com 2022-12-13 16:53 出处:网络
Our mysql instance occaisionally locks up during backups. Currently we must VPN into the corporate network (to obtain work I.P.), remote desktop into the server, open the task manager, and manually ki

Our mysql instance occaisionally locks up during backups. Currently we must VPN into the corporate network (to obtain work I.P.), remote desktop into the server, open the task manager, and manually kill the mysqld-nt.exe process.

Instead of doing all of this we are attempting to create a simple webpage that we can log into to kill and restart the service.

The following block of code is wired up inside our new .aspx page works as I intended on my local desktop (running in VS debug mode), but doesn't do anything when pushed to the server (no er开发者_如何学Crors or anything):

Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("taskkill");
myProcessStartInfo.Arguments = "/IM mysqld-nt.exe /F";
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcessStartInfo.CreateNoWindow = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
myProcess.Close();

If I run "taskkill /IM mysqld-nt.exe /F" from the command prompt on the server it kills the service. So I think it might be a permissions issue, but I'm not positive.

Can anyone spot something wrong with the code block above, or tell me how to adjust the permissions so .Net can stop/start this process?

Thanks for the help, Sam


It sounds like your page is probably running as the IUSR_MACHINE account (with limited permissions).

On your development machine, it's your account which starts the dev web server process, and you're probably logged in as a local administrator.

Make IIS ask you for a password, and turn on impersonation Then try logging in as an administrator (or some account with privileges).


This might be late, but did u check the network port(s) on the remote machine?


Wasn't able to figure out a work around to get it to work via ASP.net. I'm pretty sure it is a permission issue of some sort. Ended up using a batch file that is triggered by Scheduled Tasks to stop/start/backup MySQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消