?
Solved

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

Posted on 2016-10-25
13
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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 79

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 1000 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 79

Assisted Solution

by:arnold
arnold earned 1000 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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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