Windows – Start MySQL from the command line without losing prompt

batch filecommand lineMySQLwindowswindows 7

I'm on Windows 7. I'm trying to run a .bat file where I stop and start MySQL and run some other commands.

However, running "C:\Program Files (x86)\EasyPHP\binaries\mysql\bin\mysqld.exe" results in starting mysqld, which then occupies the prompt, and the other .bat commands are not run.

  • I tried using Start → mysqld does not start
  • Start /B → mysqld does not start
  • CMD /C → mysqld just starts in the same window
  • Start /B startMysql.bat (a seperate bat that starts mysql) → mysqld does not start

I use this to test the commands:

@echo  on
CMD /C "C:\Program Files (x86)\EasyPHP\binaries\mysql\bin\mysqld.exe"
timeout 2:
PAUSE

Best Answer

use "start":

c:>start c:\xampp\mysql\bin\mysqld --defaults-file=c:\xampp\mysql\bin\my.ini

Tested alone and inside a .bat; I am on Windows 8.1 but I expected it works on Windows 7 too

Related Question