osMac and brew for PHP 7.2 & MySQL 5.6

Install/Upgrade PHP:
Follow the steps below to upgrade / install PHP 7.1 to 7.2
Step1: Make sure the brew is updated
 brew update
brew upgrade

Step2: Unlink the previous PHP version
 brew unlink php71
Step:3 Once you have performed first 2 steps successfully, run final command to install PHP 7.2
 brew install php72

Install mySQL:
Run follow command to install mySQL
 brew install mysql@5.7
To start mySQL run:
brew services start mysql@5.7

Once database installed, MySQL database will be without a root password, to secure it run:
 mysql_secure_installation

MySQL is configured to only allow connections from localhost by default:
To connect run:
 mysql -uroot

About the author

Danyal Ali Butt

I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.

View all posts