When installing MySql 8.0 Installer for Windows, I get the following error:

This application requires Visual Studio 2015 x64 Redistributable.
Please install the Redistributable then run this installer again.

The error message seems to actually refer to the Visual C++ Redistributable per the install prerequisites. When I download the Visual C++ Redistributable for Visual Studio 2015, I get this error:

VS 2015 C++ Redistributable Cannot install a product when a newer version is installed

How can I fix this?

This is the 8.0 update to this question on installing MySQL 5.7 which seems to face a similar set of issues

Asking and answering because googling this turns up very little and it's a non-obvious solution and affecting a major release.

If Visual Studio 2017 is installed, it'll come with the 2017 C++ Redistributable, but there's a bug which prevents the installation of previous versions. So, per this thread you must:

  1. Uninstall the Visual C++ Redistributable 2017
  2. Install the Visual C++ Redistributable 2015
  3. Install MySql
  4. Re-install the Visual C++ Redistributable 2017

It can sometimes be hard to locate the Redistributable from "Add or Remove Programs". If that's the case, you can find in C:/ProgramData/Package Cache:

<!-- language: lang-bash -->
$ find "C:/ProgramData/Package Cache" -name "VC_redist.*.exe"

Then call /uninstall on both locations:

<!-- language: lang-bash -->
"C:/ProgramData/Package Cache/{427ada59-85e7-4bc8-b8d5-ebf59db60423}/VC_redist.x64.exe" /uninstall
"C:/ProgramData/Package Cache/{67f67547-9693-4937-aa13-56e296bd40f6}/VC_redist.x86.exe" /uninstall