Check out example codes for "brew reinstall mysql". It will help you in understanding the concepts better.

Code Example 1

# To uninstall
brew uninstall [email protected]
rm -rf /usr/local/var/mysql
rm /usr/local/etc/my.cnf
# To Reinstall
brew install [email protected]
brew link --force [email protected]
brew services start [email protected]

Learn ReactJs, React Native from akashmittal.com