1. Download MySQL
Visit the MySQL official website http://www.mysql.com/downloads/ and then on the page will see "MySQL
Under Community Server, there is a "Download" click.
Go to the MySQL download interface (http://www.mysql.com/downloads/mysql/), if you are using Mac OS access, then it will be selected for you by default Mac OS X platform, the following lists the MySQL versions that can be used on Mac OS. If you are using another platform, select the "select platform" option from the drop-down list.
There are many MySQL versions on Mac OS, including platform-based, such as 10.5/second and. DMG. Here I choose. DMG. Click Download on the right to download.
Next, you will be redirected to another interface, which prompts you to register it. You can directly select "No thanks, just take me to downloads!" at the bottom !", Then, the download page is displayed. This page lists many servers for download. You can select a server to download.
2. Install MySQL
Open the MySQL installation package:
Install
Mysql-5.5.16-osx10.6-x86_64.pkg: This is the main MySQL package;
Mysql_startupitem.pkg: MySQL startup item;
MySQL. prefpane: After the installation is complete, it will appear in the system preference settings, which are MySQL preference settings, which are mainly used to start the MySQL service.
3. Download and install MySQL workbench (GUI tool)
3.1 download MySQL workbench
Accessing the http://www.mysql.com/downloads/ has a MySQL below
Workbench (GUI tool) item, click Download to enter the download interface:
Then select the version and then select the server for download. There seems to be only one version:
3.2 install MySQL workbench
After the download is complete, the installation is very simple. You can double-click it to install it. After the installation is complete, we can see the MySQL workbench. app program in the "application. Double-click to open:
MySQL workbench has been installed.
After the installation is complete, we will talk about connecting MySQL Workbench to the MySQL database and then managing the database.
3.3 create a new connection
The main interface of MySQL workbench includes three modules: SQL development, data modeling, and server administration. Under SQL development, a "New Connection" dialog box is displayed after you click "New Connection". After Entering the connection name, click "OK. You can complete a connection to the local database.
After the connection is completed, the connection just created appears on the main interface, for example:
Double-click the connection name or select a connection and click "open connection to start querying" to go to the database operation interface:
All these prerequisites are that the database service must be enabled.
3.4 manage the database access password
The default password of MySQL is root/root. Normally, we can use MySQL Workbench to manage the database, however, when we access MySQL through JDBC in programming code, we will find that using this account is not good and cannot be accessed, because MySQL requires us to change the password, that is to say, the root password is the default password, that is, the weak password, which must be modified before it can be used in the code. Therefore, we need to manage the database access password.
Create a server instance
In the "server administration" module, after clicking "new server instance", a "create new server instance profile" dialog box is displayed, which can be completed step by step, generally, the local database is OK directly with the default settings. After that, we can see the created instance on the far right of the main interface of workbench.
Double-click the manager to open it. The password is required here. The root account is the one that has not been changed yet. Then there is a "security" sub-menu item "users and privileges" under the left-side menu bar. The following interface is displayed when you select this item:
In the right-side pane, there is a list of user accounts. Select the account in which you want to change the password and change the password on the right.