In this tutorial, I will show you how to install MySQL on Mac (macOS) step by step. This guide is perfect for beginners who want to start working with databases, SQL, or data analysis.
We will download MySQL, install it on macOS, and configure the system so that MySQL commands can be used directly from the Terminal.
After installing MySQL, we also add MySQL to the system PATH so that the mysql command can be used globally in the terminal.
Run the following command in your terminal:
export PATH=${PATH}:/usr/local/mysql/bin/
⚠️ Important: The path at the end of this command (/usr/local/mysql/bin/) may be different on your system.
You should replace this part with the actual MySQL bin path from your own system.
For example:
export PATH=${PATH}:/your/mysql/path/bin/
Once the path is added correctly, you will be able to run MySQL commands like this from any directory:
mysql -u root -p
This tutorial is useful for:
• Data analysts
• Data scientists
• Backend developers
• Students learning SQL
• Anyone starting with MySQL
If you enjoy learning SQL, Data Analytics, and Data Engineering, consider subscribing for more tutorials.