Mac for MySQL 5.7 installation Tutorial

Source: Internet
Author: User

First, the environment

MAC OS X 10.10

Second, download MySQL

Address: HTTP://DEV.MYSQL.COM/GET/DOWNLOADS/MYSQL-5.7/MYSQL-5.7.10-OSX10.10-X86_64.DMG

Three, double-click the installation

  

  

During installation, it is important to note that the default user root password for MySQL is no longer root, but is a dynamically generated temporary password (such as: [email protected]:? nt62r8lvrcy).
During the installation, a pop-up window will tell you the dynamic password, so remember this or copy the password, which is related to whether you can enter the database.

Iv. Configuring Environment Variables & Startup

1, vi ~/.bash_profile

Alias mysql=/usr/local/mysql/bin/mysqlalias mysqladmin=/usr/local/mysql/bin/mysql##env  java_home="/library/java/javavirtualmachines/jdk1.8.0_152.jdk/contents/home " PATH="/usr/local/mysql/bin: $JAVA _home/bin: $PATH"CLASSPATH= " .: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar " export Java_home PATH CLASSPATH
View Code

2. Start

Open System Preferences,

    

Click Start MySQL

    

After successful startup

    

3. Root login, change password

A) mysql-uroot-p

b) Modify the root password method: SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' root ');

c) Immediate refresh effective: Flush Privileges

d) Quit restarting the MySQL service

      

V. New user & assign permissions, create new database

1. Create hive database, Character set is UTF8
CREATE DATABASE hive DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
2. Create User Kimbo
CREATE USER ' kimbo ' @ ' localhost ' identified by ' 123456 '; #本地登录
CREATE USER ' Kimbo ' @ '% ' identified by ' 123456 '; #远程登录
3, to the user Kimbo assigned permissions
GRANT all privileges the hive.* to ' kimbo ' @ ' localhost ' identified by ' 123456 '; #赋全部权限
GRANT select,create on hive.* to ' Kimbo ' @ ' localhost ' identified by ' 123456 '; #赋部分权限
Flush privileges; #立即刷新

Mac for MySQL 5.7 installation Tutorial

Related Article

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.