博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CDH集群安装配置(四)- mysql 的安装
阅读量:5763 次
发布时间:2019-06-18

本文共 2305 字,大约阅读时间需要 7 分钟。

  1. 安装mysql,并且创建相关的表(只需要在chd1上面安装而且需要root权限)1.1
  • 查看Centos自带mysql是否已经安装
    yum list installed | grep mysql

 

  • 卸载自带mariadb
# rpm -qa | grep mariadbmariadb-libs-5.5.41-2.el7_0.x86_64# rpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64

 

  • 如果系统的mysql已经安装,卸载
yum -y remove mysql-libs.x86_64若有依赖关系,卸载依赖的包,知道显示结果complete
  • 查看yum库上的mysql版本信息(CentOS系统需要正常连接网络)。

 

yum list | grep mysql 或 sudo yum -y list mysql*
  • yum安装mysql数据库

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo yum update
sudo yum install mysql-server
sudo systemctl start mysqld

mysql-server、mysql、mysql-devel都安装好,当结果显示为“Complete!”即安装完毕。注:安装mysql只是安装了数据库,只有安装mysql-server才相当于安装了客户端。
  • 设置开机启动
systemctl enable mysqld
  • 启动mysql
systemctl start mysqld
  • 修改mysql密码
    mysql -urootmysql>use mysql;mysql>update user set password=password('root') where user='root' and host='localhost'; mysql>flush privileges; 验证是否修改成功mysql -uroot -proot 修改mysql 访问权限 mysql> grant all privileges on *.* to 'root'@'mini1' identified by 'root'; mysql> flush privileges;

    创建cdh默认的数据库

    GRANT ALL ON *.* TO 'root'@'%' identified by 'jesse@123';create database scm DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database rman DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database metastore DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database sentry DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database nav DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database navms DEFAULT CHARSET utf8 COLLATE utf8_general_ci;create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;GRANT ALL ON *.* TO 'scm'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'amon'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'rman'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'hue'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'hive'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'sentry'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'nav'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'navms'@'%' identified by 'jesse@123';GRANT ALL ON *.* TO 'oozie'@'%' identified by 'jesse@123';flush privileges;

     

     

转载于:https://www.cnblogs.com/Jesse-Li/p/10397164.html

你可能感兴趣的文章
Android正则表达式详解
查看>>
linux系统的vm克隆后启动找不到网卡的问题
查看>>
Loadrunner检查点使用
查看>>
outlook web access使用户可以更改过期的密码
查看>>
JFreeChart-利用JFreeChart打造漂亮报表
查看>>
lucene quickstart-基本索引
查看>>
python列表推导式中使用if-else
查看>>
Cesium中级教程3 - Camera - 相机(摄像机)
查看>>
Java学习进度(2013.03.11)—Struts2学习二
查看>>
Mysql学习进度(2013.03.12)—sql语句学习一
查看>>
userdel: user mysql is currently used by process 1489
查看>>
如何用typescript 来写一个jquery 插件的 d.ts
查看>>
oracle (+)=右连接 与 =(+)左连接
查看>>
补码、原码的求法(关系)
查看>>
Hibernate的一二级缓存
查看>>
mysql 慢查询
查看>>
shell while 循环
查看>>
限制Xamarin获取图片的大小
查看>>
VMware虚拟机直连物理网络的两种方式
查看>>
linux系统用户与组
查看>>