Install and configure MySQL under Mac

Source: Internet
Author: User
Tags mysql download

1, first to the MySQL official online download DMG format installation package, for installation.

2, after installation, alias:

Www.2cto.com

Alias Mysql=/usr/local/mysql/bin/mysql

Aliasmysqladmin=/usr/local/mysql/bin/mysqladmin

To create a password for root:

/usr/local/mysql/bin/mysqladmin-u Root Password root

To turn MySQL on or off using a terminal:

sudo/library/startupitems/mysqlcom/mysqlcom [Start | stop | restart]

Www.2cto.com

Enter the database:

Mysql-u root-p

Then enter the password: root


A bit Download MySQL

Visit MySQL's official website http://www.mysql.com/downloads/then you will see a "download" click under "MySQL Community Server" on the page.

Go to MySQL Download interface (http://www.mysql.com/downloads/mysql/), if you are using Mac OS to access, then it will be the default for you to choose the Mac OS X platform, and the following are listed in the Mac The version of MySQL that can be used on the OS, and if it is a different platform, just select it in the drop-down list of the "Select Platform" option.

There are many versions of MySQL on Mac OS, including platforms such as 10.5/10.6, then there are 32-bit and 64-bit, which you choose according to your own system, Then there is the suffix name of the file. tar.gz and. DMG, here I choose. dmg. Click Download on the right to download.

Then will jump to another interface, this interface is prompted you do not need to register, directly select the bottom of the "no thanks,just Take I to downloads!", then this really jump to the download interface, this interface column a lot of servers for download, Selecting a server to download is OK.

Two install MySQL


To open the MySQL installation package:

Individually installed

Mysql-5.5.16-osx10.6-x86_64.pkg: This is MySQL's main package;

MYSQL_STARTUPITEM.PKG:MYSQL start-up items;

Mysql.prefpane: The installation will appear in the system Preferences, is the MySQL preferences, the main is used to start the MySQL service.

three down Download installing MySQL Workbench (GUI Tool)

3.1 MySQL Workbench the next Download

Access http://www.mysql.com/downloads/below is a MySQL Workbench (GUI Tool) item, click on the download below it to enter the download interface:

Then select the server to download after the same version. There seems to be only one version here:

3.2 MySQL Workbench the installation

After the download is complete, the installation is simple and can be installed by double-clicking. After the installation is complete, we can see the MySQL Workbench.app program in the "Application". Double-click to open:


The MySQL Workbench is installed here.

After the installation is complete we will talk about MySQL Workbench connected to the MySQL database and then manage the database.

3.3 Create a new even Connect

You can see that the main interface of MySQL Workbench has three modules, SQL development,data modeling,server administration. With a "New Connection" click below the SQL development, a "Setup New Connection" dialog box will appear and click OK after filling out the connetion name. To complete a connection to the local database.


When you are finished, the connection that you just made appears in the main interface, such as:


Double-click the connection name or click "Open Connection to Start querying" after selecting a connection to enter the interface of this operation database:


All of these prerequisites are that the database service has to be opened.

3.4 Manage Data Library of the Access Dense Code

MySQL's default account password is root/root, under normal circumstances we simply use MySQL Workbench to manage the database of this account is OK, but when we in the programming code through JDBC to access MySQL, we will find that the use of this account is not , unable to access, because MySQL needs us to change the password, that is, root this is a default password is a weak password, we need to modify before it can be used in the code. So we need to manage the access password for the database.

Create a new server Instance

A dialog box with "Create New server Instance profile" pops up after a "new server Instance" click in the "Server Administration" module, followed by the dialog box, which can be done in step-by-step. Normal local database directly followed by the default setting is OK. When we're done we'll be able to see the instance we just built on the far right of Workbench's main interface.


Double-click to open the manager, here requires a password, the general has not changed is root. Then there is a "Users and Privileges" submenu under "SECURITY" under the menu bar on the left, and you will see the following screen:


In the Panel on the right, there is a list of user accounts, select the account where you want to change the password, and then change the password on the right.


Install and configure MySQL under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.