一:安装JDK
参考
https://blog.csdn.net/weixin_43446246/article/details/123328558
二:安装mysql
1.因为我们安装cdh6.3.2。cdh支持的是5.6和5.7版本的mysql。
2. 步骤
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.36-1ubuntu18.04_amd64.deb-bundle.tar
tar xvf ./mysql-server_5.7.36-1ubuntu18.04_amd64.deb-bundle.tar
sudo apt-get install ./libmysql*
sudo apt-get install libtinfo5
sudo apt-get install ./mysql-community-client_5.7.36-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-client_5.7.36-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-community-server_5.7.36-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-server_5.7.36-1ubuntu18.04_amd64.deb
- 检查mysql状态
systemctl status mysql.service
三:初始化数据库配置
- 输入命令
sudo mysql_secure_installation
- 这里是进行密码的校验,输入n
-
删除匿名用户,输入n
-
是否不允许root远程登陆,输入n,允许远程
-
是否删除test数据库,选择不删除,输入n
-
是否立即生效权限,选择是,输入y
到这里配置完成
- 检查数据库状态
systemctl status mysql.service
四. 修改密码,权限
ALTER USER 'root'@'%' IDENTIFIED WITH 'mysql_native_password' BY '81pKV6YGDmRDRMZq';
SELECT user, host FROM mysql.user WHERE user = 'root' AND host = 'localhost';
flush privileges;