• CDH集群安装配置(四)- mysql 的安装


    1. 安装mysql,并且创建相关的表(只需要在chd1上面安装而且需要root权限)1.1
    • 查看Centos自带mysql是否已经安装
      yum list installed | grep mysql
    • 卸载自带mariadb
    # rpm -qa | grep mariadb
    mariadb-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 -uroot
      mysql>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;
  • 相关阅读:
    通过Nginx,Tomcat访问日志(access log)记录请求耗时
    Nginx+Lua+Redis 对请求进行限制
    windows7+eclipse+hadoop2.5.2环境配置
    ubuntu + hadoop2.5.2分布式环境配置
    CentOS6.5上golang环境配置
    curl POST
    .sh 的运行
    CentOS 安装nginx
    Amazon ec2 改成密码登录方式
    SSH 服务器不用密码
  • 原文地址:https://www.cnblogs.com/Jesse-Li/p/10397164.html
Copyright © 2020-2023  润新知