Install Mysql Using Inno Setup Script

admin
Install Mysql Using Inno Setup Script Average ratng: 4,9/5 8269votes
Install Mysql Using Inno Setup Script

Introduction The tip contains InnoSetup script to download and install MySQL ODBC driver in generated setup package. Background I'm using InnoSetup tool for preparing setup packages for applications that I develop for my company. Because we use different database servers (MSSQL, MySQL) and different versions, very often I had to install required ODBC drivers (especially for MySQL) separately. I was not satisfied with this solution, so I have looked for some solution that solved this problem. I found the (big thank you, stfx).

I have install MySQL 5.6 using inno setup without any issue. But then i am trying to install MySQL 5.7.19 using same script its not working. I am using below script:- msiexec.exe', '/i mysql-installer-community-5.7.19.0.msi /qn INSTALLDIR='C: mysql', This script installs MySQL Installer not MySQL Server.

This article showed me a way how it is possible to do it. This article is an example how to install MySQL ODBC Driver 3.51 to x64 or x86 Windows system.

Using the Code • At first, I have used the same folder structure as in stfx's article. Because our productions PCs don't have connection to Internet, I downloaded the required ODBC installer files (X86, x64) from MySQL web site. Then I copy them to folder ' Dependencies' which is my dependency folder setting in.

Script products.iss script. #include 'isxdl isxdl.iss' [CustomMessages] DependenciesDir=Dependencies This was only one thing that I have changed in products.iss script. Mamiya 75mm Shift Lens Manual here.

• I have created two new iss scripts in folder. One for finding out if ODBC driver is already installed (. Scripts mysqlodbcinstalled.iss), second one for installaction of driver if it is not installed yet (. Scripts mysqlodbc. Scribblenauts Unlimited Online Game Free Play No Download. iss).

• Finally, I have added helper and installer to main setup iss script. Scripts mysqlodbcinstalled.iss- This script does looking for registry key in HKLM root. I have used regkey ' SOFTWARE MySQL AB '. [Code] const //mysqlodbc_reg = ' SOFTWARE ODBC ODBCINST.INI '; mysqlodbc_reg = 'SOFTWARE MySQL AB '; type MySQLODBCType = (MySQL351, MySQL501, MySQL53); function mysqlodbcinstalled(odbcversion: MySQLODBCType): boolean; var MyResult: boolean; begin MyResult:= False; case odbcversion of MySQL351: if RegKeyExists(HKLM, mysqlodbc_reg + 'MySQL Connector/ODBC 3. 51 ' ) then begin MyResult:= True; end; MySQL501: if RegKeyExists(HKLM, mysqlodbc_reg + 'MySQL Connector/ODBC 5.

01 ' ) then begin MyResult:= True; end; MySQL53: if RegKeyExists(HKLM, mysqlodbc_reg + 'MySQL Connector/ODBC 5. 3 ' ) then begin MyResult:= True; end; end; Result:= MyResult; end; •. Scripts mysqlodbc.iss - This script calls function mysqlodbcinstalled(MySQL351) and if result is false will install driver without user action. The right version of ODBC driver is selected by result of functions IsX86() and isX64(). Then add product by function AddProduct() from.

Scripts products.iss.

Note Sakila contains MySQL version specific comments, in that the sakila schema and data depends on the version of your MySQL server. For example, MySQL server 5.7.5 added spatial data, so the address table will include a spatial-aware location column on MySQL server 5.7.5 and above. The sakila-schema.sql file contains all the CREATE statements required to create the structure of the Sakila database including tables, views, stored procedures, and triggers. The sakila-data.sql file contains the INSERT statements required to populate the structure created by the sakila-schema.sql file, along with definitions for triggers that must be created after the initial data load. The sakila.mwb file is a MySQL Workbench data model that you can open within MySQL Workbench to examine the database structure.

For more information, see. To install the Sakila sample database, follow these steps. • Extract the installation archive to a temporary location such as C: temp or /tmp/. When you unpack the archive, it creates a directory named sakila-db that contains the sakila-schema.sql and sakila-data.sql files. • Connect to the MySQL server using the mysql command-line client with the following command: shell>mysql -u root -p Enter your password when prompted. A non- root account can be used as long as the account has privileges to create new databases.

• Execute the sakila-schema.sql script to create the database structure by using the following command: mysql>SOURCE C:/temp/sakila-db/sakila-schema.sql; Replace C:/temp/sakila-db with the path to the sakila-schema.sql file on your system. Note On Windows, use slashes, rather than backslashes, when executing the SOURCE command.

• Execute the sakila-data.sql script to populate the database structure with the following command: mysql>SOURCE C:/temp/sakila-db/sakila-data.sql; Replace C:/temp/sakila-db with the path to the sakila-data.sql file on your system. • Confirm that the sample database is installed correctly. Execute the following statements. You should see output similar to that shown here.