0

I'm trying to do a silent MySQL server install. Following the reference, I've called msiexec /i mysql.msi /qn to install the Installer on its default folder.

That installer ran flawlessly, and installed with no issues.

Then, I've tried running the InstallerConsole.exe by using the following command line:

MySQLInstallerConsole community install -silent server;8.0.23;x64:*:type=config;serverid=MySQL80;port=3306;rootpasswd="My secret word";installdir="C:\MySQL\MySQL Server 8.0":type=user;datadir="C:\MySQL\data";username=usr;password=pwd;role=DBA;auth_plugin=caching_sha2_password

If I understood the reference (https://dev.mysql.com/doc/mysql-installer/en/MySQLInstallerConsole.html) correctly, this should silently install all features of the 64-bit version of the 8.0.23 MySQL server, ID'ed by MySQL80, using the port 3306, with a root password My secret word, on the C:\MySQL\MySQL Server 8.0 folder, and setting its data folder to C:\MySQL\data, as well as creating a new user named usr with the password pwd with the DBAdmin role, using the caching_sha2_password auth_plugin.

However, it throws the following exception:

Exceção Sem Tratamento: System.Reflection.TargetInvocationException: Uma exceção foi acionada pelo destino de uma chamada. ---> System.InvalidCastException: [A]MySql.Installer.Plugins.Server.MySqlServerSettings não pode ser convertido em [B]MySql.Installer.Plugins.Server.MySqlServerSettings. O tipo A se origina de 'StandardPlugins, Version=1.4.37.0, Culture=neutral, PublicKeyToken=null' no contexto 'Default' no local 'C:\PROGRA~2\MySQL\MySQL Installer for Windows\StandardPlugins.dll'. O tipo B se origina de 'StandardPlugins, Version=1.4.37.0, Culture=neutral, PublicKeyToken=null' no contexto 'LoadFrom' no local 'C:\Program Files (x86)\MySQL\MySQL Installer for Windows\StandardPlugins.dll'.
   em MySql.Installer.Core.Classes.Utilities.DeepClone[T](T obj)
   --- Fim do rastreamento de pilha de exceções internas ---
   em System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   em System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   em System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   em MySql.Installer.Core.Controllers.ControllerSettings.Clone()
   em MySql.Installer.Core.Controllers.ProductConfigurationController.SetConfigurationValue(String[] pair, String& message)
   em MySql.Installer.Console.Configurator.TryToSetValue(ProductConfigurationController controller, String setting, String value)
   em System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   em MySql.Installer.Console.Configurator.SetData(Package package, List`1 valueLists, ResultCode& result)
   em MySql.Installer.Console.Configurator.TryToAdd(Package package, List`1 configData)
   em MySql.Installer.Console.Actions.InstallAction.TryToAddPackage(Package package, String _featureString, List`1 extraData)
   em MySql.Installer.Console.Actions.PackageBasedAction.GetPackageList()
   em MySql.Installer.Console.Actions.PackageBasedAction.DoAction()
   em MySql.Installer.Console.Program.Main(String[] args)

What am I doing wrong here? I am on an Administrator command prompt, using Installer v1.4.37.0. There are no other MySQL server installations on this machine, either.

Artur S.
  • 185
  • 3
  • 15
  • Does this answer your question? [How to install MySQL unattended with custom settings?](https://stackoverflow.com/questions/51293749/how-to-install-mysql-unattended-with-custom-settings) – nbk Apr 30 '21 at 19:21
  • Not exactly, that one is about the mysql installer msi package. I managed to install that with no issues. The issues arise when trying to run the MySQLInstallerConsole. – Artur S. Apr 30 '21 at 19:23
  • 1
    when you read your error message carefully(and i speak perfectly Portuguese) you cqan see that it tries to find C:\Program Files (x86)\MySQL\MySQL the default directory, it seems that the installer doesn't get the changed directory, that you should report to oracle – nbk Apr 30 '21 at 19:28
  • The file does exist, but I think you found the issue... I think it has to do with having used `PROGRA~2` to navigate to the folder rather than `Program Files (x86)`. I'll try navigating to that folder the other way and check the results. – Artur S. Apr 30 '21 at 19:31
  • Yes, that was it. Navigating to the installer's folder using the full name of the directory worked. Thanks! I'll open a bug report with Oracle as well – Artur S. Apr 30 '21 at 19:33

0 Answers0