Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-10-25
13
Medium Priority
?
267 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 your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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 80

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 80

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
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…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

604 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