0

Im trying to make aprogram that has a connection to databas om mysql. I want that when the user click on a button the server will run, and Apatche and Mysql will even run.

here my code to run Xamp, But how to run Apatche and Mysql in it ?

  private void button4_Click_1(object sender, EventArgs e)
    {
        Process c = new Process();
        c.StartInfo.FileName = @"C:\xampp\xampp-control.exe";
        c.Start();
        //Start apatchi

    }

here pic of the program and the functions i wanna run

enter image description here

1
  • Have a look at this might help you!! Commented Mar 31, 2014 at 8:48

1 Answer 1

2

Since you are running xampp there is an easier solution. Xampp usually comes packaged with a few .bat file that when run do exactly what you want. For example mysql_start.bat when run will only start MySql server and nothing else, while mysql_stop.bat will stop it (and nothing else). There is also a apache_start.bat and a apache_stop.bat.

You can execute these scripts just as you would an exe:

Process c = new Process();
        c.StartInfo.FileName = @"C:\xampp\mysql_start.bat";
        c.Start();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.