Is MAMP working as expected?

Is MAMP working as expected?

by Daniele Cordella -
Number of replies: 6
Picture of Core developers Picture of Plugin developers
I would like to execute moodle 4.2 on my MAC.
Looking at https://moodledev.io/general/releases/4.2 I get the requirement for MySQL is version >= 8.0

Moodle 4.2.2
MOODLE_402_STABLE

38 days 17 hours ago
Moodle4Mac 4.2.2
Latest release. See Roadmap for more infos.

Build with MAMP 6.8 (Apache 2.2.34, PHP 8.0.3, MySQL 5.7.39) for macOS 10.10+ and Intel x64. Runs also with Apple M1/M2.

where it is written that the version of MySQL is 5.7.39.

At the beginning I thought it was a typo but once I downloaded MAMP from the same site and I tried to execute moodle 4.2 I received the message:

Error: Database connection failed
It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have been correctly specified in config.php
Where am I wrong?
Is there something I should know that I am missing?

As usual: thanks in advance.
Average of ratings: -
In reply to Daniele Cordella

Re: Is MAMP working as expected?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't use it (even though I do use a Mac for testing and development). It does seem that it's MySQL 5.7 which isn't going to work with Moodle 4.2. There's quite a lot of discussion on the web about upgrading MySQL.

It sounds like too much hassle to me. As opposed to other solutions (i.e. not using MAMP)
In reply to Howard Miller

Re: Is MAMP working as expected?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If anybody is interested, I run an Ubuntu server VM on the M1 Mac and then run Moodle in a set of Docker containers. I know it sounds like madness but this gives all the flexibility of Docker with the speed of Linux. While Docker does run on the Mac, it's rubbish. Far too slow.

VMs are courtesy "multipass" which I recommend (https://multipass.run/)

I still run Visual Studio Code in MacOS and connect to the files in the VM over SSH (although there are probably easier ways).
Average of ratings: Useful (2)
In reply to Daniele Cordella

Re: Is MAMP working as expected?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
It's a bit complex. I run MAMP and Moodle 4.2.2 on a Macbook M1 computer.

If you download the Mac installer from Moodle.org, it contains both MAMP and Moodle. And this should work. But if you probe a little, you will see that this installation of MAMP does not have MySQL 8. The folks behind this "Moodle installer package for Mac OS X" version edited a file that then allows Moodle 4.2.2 to run in this MAMP environment.

If you download MAMP yourself and try to install Moodle 4.2.2, it will likely not work. This may be what you have done. However, you can edit the ../admin/environment.xml file, look for where MySQL is required, and manually change it to 5.7.39. Yep, kind of an ugly work-around. And you must remember to do this whenever you upgrade Moodle.

At this point in time, neither MAMP or XAMPP (PC) have the correct database versions for the current Moodle. However, I was told that the current Moodle doesn't use anything specific to the latest databases, so the code change works.
Average of ratings: Useful (3)
In reply to Rick Jerz

Re: Is MAMP working as expected?

by Ken Task -
Picture of Particularly helpful Moodlers
To the OP ... if you apply the hack suggested, *never* go to Admin  Server Check Environment and *update component* ... the last part there will acquire an environment.xml which will over write your hack and you'll have to hack again to get it to work.

'SoS', Ken

In reply to Ken Task

Re: Is MAMP working as expected?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yep, this is certainly a "hack." The folks behind these Mac and PC distributions should provide a warning similar to what you have said, Ken.

(This reminds me of what Softculous might be doing in their one-click installs.)
Average of ratings: Useful (1)
In reply to Rick Jerz

Ri: Re: Is MAMP working as expected?

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Thank you all.
I changed the required version for MySQL in admin/environment.xml (about line 3936) and continued to use my previous installation of MAMP (version 6.8) where I made available some higher php versions.

Thank you, thank you all.