Install MySQL 5 in MacBook Pro

Source: Internet
Author: User
Tags macbook

(Please refer to the original article link: http://www.davenkin.me/post/2012-10-14/40039006163)

Installing MySQL in MacBook Pro is not difficult. Download the DMG file and double-click it. Note the following points:

  • (1) The installed MySQL can be found under/usr/local/mysql-VERSION, where VERSION is the MySQL VERSION.

  • (2) The installer will also create a symbolic link/usr/local/mysql-VERSION for/usr/local/mysql to facilitate reference in the command line. For example, you can add/usr/local/mysql/bin to the environment variable.

  • (3) After installation, the root user's account is user = root, password = "". You can run mysql-u root in the command line to enter MySQL.

  • (4) because the root user does not have a password by default, we can add or modify the password for the root user in the following ways: $ mysqladmin-u root password your-new-password, here, your-new-password is your new password.

  • (5) After installing the mysql-VERSION.pkg, you can also install MySQL. prefPane, double-click this file. In this way, MySQL can be started in the System Preferences of the Mac System through GUI.

  • (6) the root user is mainly used to manage MySQL itself. Your own application should create a new user and log on as the root user. The syntax for creating a new user is as follows:

Create user user [identified by [PASSWORD] 'Password']

For example, create a user name davenkin with a password of 12345:

Create user 'davenkin '@ 'localhost' identified by '201312 ';

  • (7) the permissions for newly created users are very low. In this case, we need to grant permissions to the newly created users:

    Grant all privileges to mydb. * TO 'davenkin '@ 'localhost' with grant option;

    The above GRANT statement opens all permissions for davenkin on the mydb database. In this case, MYDB may not be stored and will be created after logging on to davenkin.

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.