mysql-5.7.17-macos10.12-x86_64.dmg
, which will open a window
showing a .pkg file.
Click on Continue to proceed.
If you click on the Customize button, instead, you can deselect options
By default, MySQL Test
, which is a Test package having the test
binaries, will not be installed.
The following options are selected to be installed as part of the standard installation, but can be deselected at this screen.
MySQL Server | The MySQL Server software and associated utiities |
Preference Pane | A preference pane that can start and stop the MySQL server |
Launchd | Start the MySQL server via launchd and enable automatic start on boot |
Click on the OK button after you have written down the password.
The MySQL software is now installed, but not started. You can start the software through the MySQL icon you should see within System Preferences, which you can reach by clicking on the Apple icon at the upper, left-hand corner of the screen.
Note: The MySQL preference pane only starts and stops MySQL when the software has been been installed in the default location. Alternatively, though, if you installed Launchd Support, which is installed by default, you can start and stop the software by opening a Terminal window, i.e., a shell prompt, and using the instructions at Installing a MySQL Launch Daemon.
When you click on MySQL, You will then see a window displaying the MySQL Server Status. If you wish to have the MySQL Server automatically start when the system boots, leave the check box next to "Automatically Start MySQL Server on Startup" checked. You can start the software by clicking on the Start MySQL Server button.
You will be prompted to provide a username and password for an account with administrator privileges on the system. When you provide those, you should see the status change to "running" and the button change to Stop MySQL Server.
You can close the MySQL window once you have started the software. You can verify the software is working by issuing the following command at a Terminal window:
$ /usr/local/mysql/bin/mysql --version /usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.7.17, for macos10.12 (x86_64) using EditLine wrapper $
If you wish to change the MySQL root password, which isn't the same as the system's root account password, to something you can more easily remember, you can do so using the mysqladmin command as shown below. You will first be prompted to provide the current password. When you provide that password, you will be prompted for the new password and then asked to retype the new password to ensure you have not mistyped it, since the password is not echoed back to you as you type it.
$ /usr/local/mysql/bin/mysqladmin -u root -p password Enter password: New password: Confirm new password: Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety. $
The warning let's you know that if you are using accessing the server remotely, you may potentially expose the password to others snooping on network traffic, if you provide the password over an unencrypted connection.
You can obtain a MySQL command prompt using the root MySQL account and the password provided earlier by issuing the command below:
$ /usr/local/mysql/bin/mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 130 Server version: 5.7.17 Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
You can type exit
to return to the
Bash shell prompt.