MySQL 8 or MariaDB with MAMP Pro 6.xDec 13, 2022
MAMP Pro 6.x has an old version of MySQL. Version 6.6.4 comes with MySQL 5.7.34. This is a old Version Database-Engine. On many production-Servers there is running MariaDB or MySQL 8. When you need a newer Version on your Development-Machine, then you must set the Port of the integrated MAMP Pro-MySQL to 3307.
To Install MariaDB or MySQL 8 on MacOS you can use Homebrew (https://brew.sh/). And then
brew install mariadb
brew install mysql
and follow the installation instructions:
You MUST install MySQL 8 or MariaDB with Socket-Authorization.
MariaDB and MySQL 8 Port
After installation MySQL 8 or MariaDB listen on Port 3306.
Connection with Laravel:
Connection with Standard-PHP:
$mysqli = new mysqli("localhost", "user", "password", "database", 3306, "/tmp/mysql.sock");
If you want to use the built-in MySQL 5.x, then you have to specify the port with the database connection in the future.
In Standard PHP:
$mysqli = new mysqli("127.0.0.1", "user", "password", "database", 3307);
Have fun with the new possibilities