1. Download
For Mac Apple Silicon (ARM64), download MySQL from the official MySQL website:
MySQL Community Downloads – macOS ARM64
Required components:
- MySQL Community Server – Database server
- MySQL Workbench – Database management and development tool
- MySQL Shell – Optional, useful for advanced MySQL administration
2. MySQL Server Installation
Install the downloaded MySQL Server .dmg package.
After installation, verify the MySQL binary:
ls -l /usr/local/mysql/bin/mysql
Expected:
/usr/local/mysql/bin/mysql
3. Configure MySQL PATH
The MySQL binary may not automatically be available from the terminal.
zsh
macOS normally uses zsh:
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Bash
For Bash:
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Also add it to .bashrc if required:
echo 'export PATH="/usr/local/mysql/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
4. Verify MySQL Installation
Check the MySQL client:
which mysql
Expected:
/usr/local/mysql/bin/mysql
Check the version:
mysql --version
Example:
mysql Ver 8.x.x for macos...
5. Connect to MySQL
Connect using the root account:
mysql -u root -p
Enter the MySQL root password configured during installation.
After successful login:
SELECT VERSION();
6. Check MySQL Server Status
The MySQL installer normally installs MySQL as a macOS service.
Check the process:
ps aux | grep mysqld
You can also check MySQL from:
System Settings → MySQL
From there, you can start or stop the MySQL server.
7. MySQL Workbench
Install MySQL Workbench for the graphical database management interface.
Create a local connection with:
Connection Name: Local MySQL
Hostname: 127.0.0.1
Port: 3306
Username: root
Password: <your MySQL password>
Then test the connection.
CLI connection
mysql -u root -p
Workbench connection
MySQL Workbench
↓
Local MySQL
↓
127.0.0.1:3306
↓
root
8. Create a Development Database
After connecting:
CREATE DATABASE dev_database;
Check databases:
SHOW DATABASES;
Select the database:
USE dev_database;
9. Create a Development User
For application development, it is better to use a separate database user instead of using root.
CREATE USER 'devuser'@'localhost'
IDENTIFIED BY 'YourStrongPassword';
Grant access:
GRANT ALL PRIVILEGES ON dev_database.*
TO 'devuser'@'localhost';
Apply privileges:
FLUSH PRIVILEGES;
Test:
mysql -u devuser -p dev_database
10. Useful MySQL Commands
Check databases:
SHOW DATABASES;
Select database:
USE dev_database;
List tables:
SHOW TABLES;
Check table structure:
DESCRIBE table_name;
Check current user:
SELECT USER();
Check server version:
SELECT VERSION();
Exit MySQL:
EXIT;
11. MySQL Configuration Location
The MySQL installation is commonly located at:
/usr/local/mysql/
MySQL client:
/usr/local/mysql/bin/mysql
MySQL configuration may be located at:
/etc/my.cnf
or:
/usr/local/mysql/etc/my.cnf
The exact configuration location can vary depending on the MySQL version and installation method.
12. Development Environment Summary
| Component | Purpose |
|---|---|
| MySQL Community Server | Runs the local MySQL database |
| MySQL Workbench | GUI for database development and administration |
| MySQL Client | Terminal-based database access |
| MySQL Shell | Advanced MySQL administration |
| Port 3306 | Default MySQL port |
/usr/local/mysql/bin |
MySQL command-line binaries |
Quick verification
Run:
which mysql
mysql --version
mysql -u root -p
For a working local development environment, all three commands should work successfully.
Top comments (0)