mysql silent install and configure in nsi

1

I want to silently install MySQL 5.0 in NSI. I tried the following code in NSI:

  ExecWait 'msiexec /i "$INSTDIR\mysql-essential-5.0.27-win32.msi" /qn'
  ExecWait "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlinstanceconfig.exe -i -q ServiceName=MySQL RootPassword=root ServerType=DEVELOPMENT    DatabaseType=MYISAM Port=3306 RootCurrentPassword=root"

This installs the MySQL but doesn't cofigure it.

I want to configure it with

  • pass=root
  • port=3306
  • servicename=Mysql
  • and enable root access from remote machine

EDIT1

Now it's getting configured...

For serverhost as localhost or 127.0.0.1 it works, but not for the ip addreses of the other systems .which are on network.

If I try to access the database on silently installed database from PC on network I get the following error:

enter image description here

I think this is because I need to pass some parameter for and enabling root access from remote machine..

pradnya

Posted 2012-04-18T11:46:13.037

Reputation: 113

Answers

0

Try quoting the mysqlinstanceconfig.exe filename, like this:

ExecWait 'msiexec /i "$INSTDIR\mysql-essential-5.0.27-win32.msi" /qn'
ExecWait "$\"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlinstanceconfig.exe$\" -i -q ServiceName=MySQL RootPassword=root ServerType=DEVELOPMENT    DatabaseType=MYISAM Port=3306 RootCurrentPassword=root"

The reason for this is that you have spaces in the path to the executable name. That path must be surrounded with quotes so it can form a single path.

Ove

Posted 2012-04-18T11:46:13.037

Reputation: 1 447

it still not getting configured...:(.. is the configuring code correct? – pradnya – 2012-04-18T12:23:11.137

I have only ran the two commands you specified, and MySQL Query browser is working for me. It can connect locally to the database. – Ove – 2012-04-18T13:07:39.327

i want to connect it remotely.. how to do that.. i have edited my question.. – pradnya – 2012-04-18T13:10:03.077

Try adding SkipNetworking=no in the commandline for mysqlinstanceconfig. You can see all the parameters here

– Ove – 2012-04-18T13:12:17.420

do i have to add SkipNetworking=no at end of Execwait line ? ExecWait "$"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlinstanceconfig.exe$" -i -q ServiceName=MySQL RootPassword=root ServerType=DEVELOPMENT DatabaseType=MYISAM Port=3306 RootCurrentPassword=root SkipNetworking=no"

then not working..( – pradnya – 2012-04-18T13:24:21.420

Try restarting the MySQL service after you have configured it. If not even that works, I'm afraid I can't help you further since I don't have 2 networked computers to test on. – Ove – 2012-04-18T13:28:08.490

0

The whole command passed to ExecWait should be enclosed in '' if it contains spaces.

The parameters inside your parameters, need to be enclosed in "" if they contain spaces. You can see a perfect example of how to do it correctly in your first call to ExecWait.

Note, if the command could have spaces, you should put it in quotes to delimit it from parameters. e.g.: ExecWait '"$INSTDIR\command.exe" parameters'.

Source: Documentation

Der Hochstapler

Posted 2012-04-18T11:46:13.037

Reputation: 77 228