How To Install MySQL Database Server On Windows Nano Server 2016 (April 2017)

In this article, I’ll show you how I Install MySQL Database Server on Windows Nano Server 2016.

I have to say that I took me a while to figure the right way to Install MySQL Server on Nano Server because many of the blog that shows how to Install it didn’t really Install It and they just wrote the steps without actually Installing it.

I was very disappointed to see many TechNet blogs getting it wrong.

At NTWEEKLY.COM, we only post articles for things that we actually tried, deployed and know 100% that they are working In practice and not In theory and this rule applies to all the 950+ articles on our blog.

To get started, There are a few requirements to get this working and I’ve listed them below with an article to help you:

  1. Nano Server 2016 VM with the latest update
  2. Connect To Nano Server 2016 Using Saved Credential
  3. Static IP address
  4. Firewall disabled or enabled with MySQL ports open
  5. Copy files to Nano Server 2016

Once all the requirements are covered, Download MySQL from the URL below to a desktop machine and extract all the files:

Extract all files to a folder called MySQL

Copy the extracted files to Nano Sever and make sure all the files located In the MySQL folder and not Inside a subfolder.

Folder should look like this

In the MySQL, Server folder create an empty directory called Data

Connect to the Nano Server using PowerShell and run the lines below to add a path to the MySQL command shell

$env:path += ";C:\MySQL\bin"

The line below will keep the path In place after reboot

setx PATH $env:path /M

Next, run the line below to Initialize MySQL

C:\MySQL\bin\mysqld.exe --initialize --console;

Next, I’ll set the root password using a  TXT file saved on c:\mysql

Set-Content -Value “ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password123';” -Path "C:\MySQL\mysql-init.txt" -Encoding Ascii ;

Now I’ll run the line below to save the password

MySQLd --init-file="c:\\mysql\\mysql-init.txt" --console

And finally, run the line below to Install the Service

mysqld –install

Next, Start the Service using

Start-Service MySQL

To check the version number run

Mysql --version

Update: This article marks the 100th Nano Server 2016 article, a goal we set back In late 2016, to view all articles visit out Nano Server home page.






One response to “How To Install MySQL Database Server On Windows Nano Server 2016 (April 2017)”

  1. Mark Torng Avatar
    Mark Torng

    If you are having issues at the “C:\MySQL\bin\mysqld.exe –initialize –console;” phase:

    Ensure you have Microsoft Visual C++ 2013 Redistributable Package installed per the MySQL 5.7 installation guide. I was banging my head against the wall for a bit there!