Download MySQL from https://dev.mysql.com/downloads/mysql/
Use (x86, 64-bit), DMG Archive version
Open .dmg and run the installer

Use ‘legacy’ option if you want to use phpMyAdmin, wordpress etc

Keep a strong password which you’ll need later to log into MySQL
Fix the 2002 MySQL Socket error
Open Terminal and enter
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Download phpMyAdmin from https://www.phpmyadmin.net/downloads/
unzip the folder and move it to the web directory that is “Sites”
now goto web browser and open your web folder