Skip to content

Instantly share code, notes, and snippets.

@lezi
Created November 13, 2011 20:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lezi/1362654 to your computer and use it in GitHub Desktop.
Save lezi/1362654 to your computer and use it in GitHub Desktop.
Silent instalation of mysql
This entry provides instructions for “silently” installing MySQL on a Microsoft Windows server. I use the term “silent install” to describe the method of passing parameters to the Microsoft Installation Package (MSI) to bypass installation screens. This allows you to deploy MySQL with your application and to install MySQL without end-user intervention. The developer can define the install location, the appropriate storage engines, the root password and the server configuration.
Most application developers use some sort of software for creating an application installer. Common tools include Install Shield, Wise Installation, InstallBuilder and Windows Installer. These installation software tools can also be used to install MySQL by launching the MySQL MSI and the MySQL Instance configuration utility ( MySQLInstanceConfig.exe ) from the command-line.
To get started, download the Windows Essentials from http://dev.mysql.com/downloads.
Then, look for an option in your installation tool to execute the following:
C:\>msiexec /q /log install.txt /i mysql-advanced-5.1.32-win32.msi datadir=”c:\installs\myapp” installdir=”c:\installs\myapp”
The MSI installer will add MySQL to the start menu, add registry values and add MySQL to the add/remove programs option from the control panel.
To configure the server, prepare the my.ini, set the root password and start the service, you’ll need to execute the following:
C:\>MySQLInstanceConfig.exe -i -q “-lC:\mysql_install_log.txt” “-nMySQL Server 5.1.234” -pC:\installs\myapp” -v5.1.234 “tc:\installs\myapp\my-small.ini” “-cC:\mytest.ini ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS Port=3311 ServiceName=MySQLCust RootPassword=1234
@vishal-parmar
Copy link

hey there are not working configuration command

@gerad-wegener
Copy link

It has changed now to MySQLInstallerConsole instead of MySQLInstanceConfig. This worked for me (Note: Still run the msiexec command as OP instructed)

C:> MySQLInstallerConsole community install server;8.0.25:*:port=3306;serverid=2:type=developer;username=AdminUsername;password=AdminPassword;role=DBManager -silent
C:> MySQLInstallerConsole community install server;8.0.25;x64 -silent

Reference:
https://dev.mysql.com/doc/refman/8.0/en/MySQLInstallerConsole.html

@suravarapusuryakiran
Copy link

Hi Guys, I'm a DevOps guy trying to automate a Mysql server on Windows without any manual intervention .! I had no past experience with batch or PowerShell script as I'm a core Linux guy.! Hope you guys can help me here please .!

Could you please provide me with this install?txt file and how it should be parameterized

msiexec /q /log install.txt /i mysql-advanced-5.1.32-win32.msi datadir=”c:\installs\myapp” installdir=”c:\installs\myapp”

Thanks a ton.!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment