在虚拟机上安装MySQL:
- 1、通过yum命令卸载Linux上自带的MySQL。yum remove mysql-libs
- 2、安装MySQL
rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.19-1.el7.x86_64.rpm (可选,但还是装上,后面装HUE的时候会用到。)
- 3、启动MySQL:service mysqld start 或者:systemctl start mysqld.service
- 4、查看root用户的密码:cat /var/log/mysqld.log | grep password
- 5、登录后修改密码:alter user 'root'@'localhost' identified by 'Welcome_1';
- 6、 MySQL数据库的配置:
创建一个新的数据库:
create database hive;
创建一个新的用户:
create user 'hiveowner'@'%' identified by 'Welcome_1';
给该用户授权
grant all on hive.* TO 'hiveowner'@'%';
grant all on hive.* TO 'hiveowner'@'localhost' identified by 'Welcome_1';
来源:https://blog.csdn.net/btt2013/article/details/102759527