8

When i'm building an Blank App in visual studio with Cordova Apache Tools, i got this error:

'MySQL' is not recognized as an internal command.

------ Build started: Project: FirstAppInCordova, Configuration: Debug Android ------

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling. 
GeneratedJavascript=

C:\Users\Douglas\documents\visual studio 2013\Projects\FirstAppInCordova\FirstAppInCordova>call "C:\Program Files (x86)\nodejs\"\nodevars.bat 

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(208,5): error : 'MySQL' n�o � reconhecido como um comando interno

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(208,5): error : ou externo, um programa oper�vel ou um arquivo em lotes.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(208,5): error : 'MySQL' n�o � reconhecido como um comando interno

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(208,5): error : ou externo, um programa oper�vel ou um arquivo em lotes.

 Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.

Android Emulator is running on AVD Control.

UPDATE I fixed it by add in the system variable the bin folder of mysql server, now the output log just return:

------ Build started: Project: FirstAppInCordova, Configuration: Debug Android ------

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.

  GeneratedJavascript=
  C:\Users\Douglas\documents\visual studio 2013\Projects\FirstAppInCordova\FirstAppInCordova>call "C:\Program Files (x86)\nodejs\"\nodevars.bat 

  Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.

  ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\1DKIFLHP.GW1\packages\vs-mda
Douglas Franco
  • 591
  • 5
  • 13
  • The Cordova Tooling in VS doesn't have any references to MySQL. You mention that you have MySQL Server installed. Can you identify what specific MySQL tools you have installed? There must be an interaction going on between the 2 sets of tools that's causing this error. – Ellen Dec 17 '14 at 21:07
  • 1
    I had the same problem. Just to clarify for others, you go to Control Panel, System, Advanced system settings, click Environment Variables (on Advanced tab), then add a new one called MySQL with the path to the bin folder where your mysql.exe is located. – GregInWI2 Dec 28 '14 at 22:40

2 Answers2

11

This looks like it occurs when you already have mySql installed on the box.

I fixed by adding quotes around the following MySql items in the path. Be sure and restart VS once you've made the path changes.

...;"C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.2 & MySQL Utilities 1.5.2 1.5"\;"C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.2 & MySQL Utilities 1.5.2 1.5\Doctrine extensions for PHP\";...

I also added a user with the name of ODBC to mySql with a blank password... prolly not wise, but this is my personal dev box.

Jim Harkins
  • 383
  • 4
  • 15
  • Though the build is successful after doing the above, I am not able to run the app. – vijayst Jan 20 '15 at 07:27
  • 1
    Path problems with spaces in the path in.. 2015.. by the company that introduced them into "Program Files"! Quotes worked for me, too. – Andreas Reiff Apr 23 '15 at 11:50
1

I've solved by removing doing what Jim says and also removing C:\Users\Miquel\AppData\Roaming\npm\node_modules\vs-mda\node_modules\*.* and C:\Users\Miquel\AppData\Roaming\npm-cache\*.*

Then in cmd I went to C:\Users\Miquel\AppData\Roaming\npm\node_modules\vs-mda and ran:

npm install
Miquel
  • 8,339
  • 11
  • 59
  • 82