How do I properly set up another version of MySQL within Wamp?
Posted by: Malkalypse (---.hsd1.il.comcast.net)
Date: July 30, 2017 11:13PM

I am using Wampserver 3.0.6 (64-bit) on Windows 10. Everything works fine on the default settings, but the lessons I am taking require MySQL 8.0 or higher. I know it is possible to set up Wamp to work with multiple versions of a language, but after hours of attempts and following various directions found through Google, I have not been able to successfully get this working. I do not have any databases that require backing up, so that is not a concern at this point, though of course I will need to know how to do so eventually.

From what I understand, the steps are something like the following:

- Download MySQL version and extract to a folder, e.g. mysql-8.0.2-dmr-winx64
- Copy the contents of the folder to a new mysql subdirectory, e.g. wamp64/bin/mysql/mysql8.0.2
- Copy the data folder from mysql5.7.14 to mysql8.0.2
- Copy wampserver.conf from mysql5.7.14 to mysql8.0.2
- Copy my.ini from mysql5.7.14 to mysql8.0.2
- Edit mysql8.0.2/my.ini and replace all instances of mysql5.7.14 with mysql8.0.2 (then save)
- Run WampServer64 as administrator

At this point, if I hover MySQL -> Version in my taskbar, it shows 5.7.14 with a check, and 8.0.2 below it. I click on mysql8.0.2 and a command window quickly opens and closes. At this point, the WampServer icon in my taskbar is orange. If I hover it, it says "local server - 1 of 2 services running". If I try to run the MySQL console, a command window opens and asks for a password. I hit enter because no password is set, and the command window says "ERROR (something something)" and instantly closes.

What is is that I am doing wrong?

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: Otomatic (Moderator)
Date: July 31, 2017 09:44AM

Hi,

MySQL 8.0.2
Branch 8 of MySQL is a branch under development. Versions can evolve from one day to the next without any guarantee of compatibility between these versions.

MySQL says: This is a milestone release, for use at your own risk. Upgrades between milestone releases (or from a milestone release to a GA release) are not supported.

> - Copy the data folder from mysql5.7.14 to mysql8.0.2

Huge mistake! The data folder should never be copied between different versions of MySQL and it never works between different branches.
Just a small indication to create the data folder, but not sure it is still valid for branch 8:
wamp64\bin\mysql\mysql8.0.2\bin\mysqld.exe --initialize-insecure

The "lessons" that ask you to use MySQL 8 are irresponsible. This way of doing it while wanting to use a version under development shows the little seriousness of such courses.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 07/31/2017 10:56AM by Otomatic.

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: Malkalypse (---.hsd1.il.comcast.net)
Date: August 01, 2017 01:25AM

Thanks for the input!

As I said I don't need to copy any data yet, so that part doesn't concern me as much -- although I should apparently just use mysqldump. I have tested using it and it seems fairly straightforward.

Anyway, from what I've looked at, I will probably only need MySQL 8 for the lessons relating to CTEs, since they are unsupported by MySQL previous to that. That gives me some time to work with 5.7 and figure out what I need to do to get 8 working later on. I've installed 8 previously (I /think/ 8.0.1) and had it working with Wamp, so I know it can be done. But when I tried again on my computer at home, no luck.

It would be more convenient to be have a laptop that I can use at both places but the laptop I have is ancient and running Vista..

EDIT:
Anyway, if I could just find a "definitive" guide for adding a new version of MySQL to Wamp, I can worry about the idiosyncrasies of MySQL 8 later. As I said, this is for learning purposes, and I won't be making any databases that I will need later on down the line anyway.



Edited 1 time(s). Last edit at 08/01/2017 01:28AM by Malkalypse.

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: Otomatic (Moderator)
Date: August 01, 2017 09:37AM

Hi,

The procedure you have proposed is "almost" the right one!

- Exit Wampserver
- Download MySQL version and extract to a folder, e.g. mysql-8.0.2-dmr-winx64
- Copy the contents of the folder to a new mysql subdirectory, e.g. wamp64/bin/mysql/mysql8.0.2
- Open a command windows (as an administrator) on wamp64/bin/mysql/mysql8.0.2/bin/
- Type : mysqld.exe --initialize-insecure
--- This will create the right data folder
- Copy wampserver.conf from mysql5.7.14 to mysql8.0.2
- Copy my.ini from mysql5.7.14 to mysql8.0.2
- Edit mysql8.0.2/my.ini and replace all instances of mysql5.7.14 with mysql8.0.2 (then save)
- Run WampServer64 as administrator

This worked perfectly on my WAMPServer 3.0.9 x64:


---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: Malkalypse (---.hsd1.il.comcast.net)
Date: August 01, 2017 06:58PM

Fantastic, worked like a charm! Thanks smiling smiley

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: ChrisRG (129.205.129.---)
Date: November 14, 2023 12:19PM

I'm having more or less the same issue but the same steps are doesn't seem to apply to my situation.

Basically i have a WAMP server on version 3.3.1, PHPadmin 5.2.1, the database is currently sitting on MySQL 5.7.31, our vulnerability management picked up that that version of MySQL needs to be patch, so i downloaded MySQL 5.7.42 x86 from [wampserver.aviatechno.net] and installed it, so currently in the C:\wamp\bin\mysql i have versions.
If i open phpMyAdmin 5.2.1 is see that the server version is still showing the old version and if i change the MySQL from the wampserver tools i get a database error when browsing to the site, which leads be to believe that the reason for that is because there's no database associated with that version, how do i go about doing that?

Options: ReplyQuote
Re: How do I properly set up another version of MySQL within Wamp?
Posted by: Otomatic (Moderator)
Date: November 14, 2023 03:07PM

What is displayed at the end of the installation of a new MySQL version?

To change your MySQL Version
Start Wampserver 3
Icon Wampmanager -> MySQL -> Version -> Click on the version number
Wait until the icon again become GREEN
The only one user is "root" without password. It will add users and passwords from the previous version.

Transfer of databases from the previous version must be only performed by export / import in SQL files.
NEVER copy data directories or files between MySQL versions.

So, BEFORE switching to the new version of MySQL, you need to export your databases in SQL files.
You're switching MySQL versions and BEFORE importing the SQL files, you need to create the databases and users you had on the old version of MySQL.

See also items number:
- 9 - MySQL/MariaDB - Moving Databases - MySQL upgrade
- 11 - MySQL/MariaDB user management
of Wampserver 3 - Some explanations

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.