- Visit http://dev.mysql.com/downloads/mysql/;
- Download the latest .dmg archive;
- Open the downloaded file and follow on-screen instructions;
- You will receive a prompt window with the MySQL server password - store it in a temporary location;
- Append the following to your
~/.bash_profile
or~/.zshrc
;
export PATH=${PATH}:/usr/local/mysql/bin
The MySQL preference pane enables you to start, stop, and control MySQL server within System Preferences.
To install MySQL preference pane follow the instructions here: http://dev.mysql.com/doc/refman/5.6/en/macosx-installation-prefpane.html
Please note: The latest versions of the MySQL installer install the preference pane automatically. Check if you already have the preference pane installed. Go to System Preferences and look for a MySQL icon.
- Go to
System Preferences > MySQL
; - Uncheck the
Automatically Start MySQL Server on Startup
option.
Please note: This is an important step in order to be able to connect with MySQL Workbench. See this related stackoverflow question for further info.
- Go to
System Preferences > MySQL
; - Make sure the MySQL server is running. If not, start the server;
- Run the following command in a terminal;
mysql --user root --password
Enter the server password you were given during MySQL server installation.
- Execute the following SQL command;
SET PASSWORD = PASSWORD('<new password/>');
- Enter
quit
to exit the MySQL CLI session; - Store password in a secure location, e.g. KeePassX.
MySQL Workbench is the official MySQL client. It's free, as in beer, and quite powerful.
- Visit http://dev.mysql.com/downloads/tools/workbench/;
- Download the latest .dmg archive;
- Open the downloaded file and follow instructions.
- Run MySQL Workbench that should already be installed in your system;
- Go to
Database > Manage Connections...
from the top menu; - Hit the New button from the bottom left corner;
- Provide a meaningful connection name, e.g
root@localhost
; - Press the Store in Keychain... button next to the Password label;
- Enter the server password you provided during password reset;
- Hit the Test connection button;
- Assuming you got a success message, hit OK and your are done.