MAC OS X 10.10
地址:http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10-osx10.10-x86_64.dmg
安装过程中需要注意的是,MySQL已经默认用户root的密码已经不再是root, 而是动态生成的一个临时密码(如:root@localhost: ?nt62r8lvrcY) 。 在安装过程中会出现一个弹窗告诉你动态密码,千万要记住这个或者拷贝下这个密码,这关系着你能不能进入数据库。
1、vi ~/.bash_profile
alias mysql=/usr/local/mysql/bin/mysql alias 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、启动
打开“系统偏好设置”,
点击启动mysql
启动成功后
3、root登录,修改密码
a) mysql -uroot -p
b)修改root密码方法:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
c)立即刷新生效:flush privileges
d)退出重启MySQL服务
1、创建hive数据库,字符集是utf8 CREATE DATABASE hive DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 2、创建用户 kimbo CREATE USER 'kimbo'@'localhost' IDENTIFIED BY '123456'; #本地登录 CREATE USER 'kimbo'@'%' IDENTIFIED BY '123456'; #远程登录 3、给用户kimbo 赋权限 GRANT ALL PRIVILEGES ON hive.* to 'kimbo'@'localhost' IDENTIFIED BY '123456';
utf8 CREATE DATABASE hive DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
CREATE USER 'kimbo'@'localhost' IDENTIFIED BY '123456'
CREATE USER 'kimbo'@'%' IDENTIFIED BY '123456'
GRANT ALL PRIVILEGES ON hive.* to 'kimbo'@'localhost' IDENTIFIED BY '123456'
GRANT select,create ON hive.* to 'kimbo'@'localhost' IDENTIFIED BY '123456';
GRANT select,create ON hive.* to 'kimbo'@'localhost' IDENTIFIED BY '123456'
flush privileges; #立即刷新
原文链接:https://www.cnblogs.com/kimbo/p/8724595.html