Solved

Using winfows 7 and 10 download en install MYSQL server from a batch

Posted on 2016-10-25
13
125 Views
Last Modified: 2016-11-14
Is it possible to download and install MYSQL server (if possible latest version) within a batch file

Thanks Danny
0
Comment
Question by:Danny Kon
  • 5
  • 5
  • 2
13 Comments
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 41859468
Hi!

You should take a look at the MYSQL Installer  which basically downloads the product for you and  you could use it to automate install and/or upgrade of MySQL Server using batch script.

https://dev.mysql.com/doc/refman/5.5/en/windows-installer-msi-quiet.html
https://dev.mysql.com/doc/mysql-installer/en/MySQLInstallerConsole.html

Here is a link to a tutorial of the MySQL Installer GUI
http://www.mysqltutorial.org/install-mysql/
to get familiar with what it can do.

You can then use the MySQLInstallerConsole in a PowerShell batch script. :)

Regards,
     Tomas Helgi
0
 
LVL 6

Author Comment

by:Danny Kon
ID: 41859823
Thomas,

But is it also possible to download and install the installer from the internet by batch

Danny
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 41859842
Hi!

I have not tried that. By running the GUI installer you could see what products are available through it. If the installer itself is part of the productlist you should be able to download and install/upgrade it using the installer and in a batch as well.

Regards,
     Tomas Helgi
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 6

Author Comment

by:Danny Kon
ID: 41859932
Thomas

the command
msiexec /i http://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-5.7.16.0.msi /passive
Does download the file direct from the internet but now i need to know how to find the package (the name will change)and wait till is downloaded and then to install the package

I want to
download and install MySQL
and put an DB to the system
Something like underneath but then it has to work :)
msiexec /i http://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-5.7.16.0.msi /passive
msiexec /i mysql-5.7.16.0.msi /passive
mysql -u root -p < dbname.sql

Thanks Danny
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 41860081
Hi!

The MySQLInstallerConsole, as I pointed out earlier, has a LIST parameter that list all available products that can be downloaded through the installer and installed/upgraded.
Usually a download from internet through a batch program is directed to "current directory" which the batch session was invoked in unless you change the "current directory" path in your batch script which you then can monitor in the script.

Regards,
    Tomas Helgi
0
 
LVL 6

Author Comment

by:Danny Kon
ID: 41860330
Tomas,

Thanks for your answer and this give me direction but it doesn't solve my problem

I really need the batch

Something like underneath but working

set installer="C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe"
set version=5.7.16.0
echo -----------------------
echo Details
echo -----------------------
echo Server User: root
echo.
echo Server Password: %password%
echo.
echo Configuration Folder: %installer%
echo.
echo Version: %version%
echo -----------------------
echo Start Installation
echo.

msiexec /i "%~dp0\mysql-installer-community-%version%.0.msi" /qb

%installer% community installserver;%version%;X64:*:port=3307;openfirewall=true;passwd=%password% -silent
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 41860623
Hi!

Regarding the Installer itself. Have you checked if the Installer is in the product list in the GUI ?
You will need to download the first Installer yourself and distribute it to other servers using a batch script.
If the installer is in the list then you can after the initial install of the MySQLInstaller upgrade it on the server that the batch is running on.
For the MySQL Server you first install the server then you configure after a successfull install.

Regards,
    Tomas Helgi
0
 
LVL 6

Author Comment

by:Danny Kon
ID: 41865407
Thomas,

The installer and the software is not the problem, the problem is the batch

Thx Danny
0
 
LVL 77

Expert Comment

by:arnold
ID: 41881503
Directly attempting to run an installer from internet source will likely be blocked by UAC.
How often do you need to do this that it requires this type of aitomation?
Is this a donain based setup such that you could deploy the package using GPO software deployment.
Though automating upgrades while often straight forward, one has to look at the changes to make sure features one might rely in are no longer available in the newer version.

Download to a central local repository and deploy/install it from the local location.
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 250 total points
ID: 41881802
0
 
LVL 6

Author Comment

by:Danny Kon
ID: 41884719
arnold,

Sorry for the late respons, as you can see in my example its no need to install it direct from the internet
I can install the software on a local environment and do it from there
I have a POS system need to be installed 10 / 20 times per week on different low budget PC's  with windows 7 and 10  
The thing i want to accomplish is install a standard mysql and copy the POS DB to mysql

Example:
set installer="C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe"
set version=5.7.16.0
echo -----------------------
echo Details
echo -----------------------
echo Server User: root
echo.
echo Server Password: %password%
echo.
echo Configuration Folder: %installer%
echo.
echo Version: %version%
echo -----------------------
echo Start Installation
echo.
msiexec /i "%~dp0\mysql-installer-community-%version%.0.msi" /qb
%installer% community installserver;%version%;X64:*:port=3307;openfirewall=true;passwd=%password% -silent
mysql -u root -ppassword < dbname.sql

Thomas, again thanks for helping but this is to much general info i need somebody to help me with the batch or translate this to Powershell

Thanks Danny
0
 
LVL 77

Assisted Solution

by:arnold
arnold earned 250 total points
ID: 41884762
I am not sure what you are asking.
Set sets/defines variables.

Use the batch as a reference. Are you running this batch/installer from a USB/network?
Do you build the POS systems from scratch, any though of creating an os images that you then deploy with the MySQL/db already installed?
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
recover deleted files by error 37 109
Change size 15 43
Disk Quota Windows 2012 R2 5 58
Present Absent from working date rage 11 21
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question