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