大叔经验分享(50)hue访问mysql(librdbms)

 cloudera manager安装hue后想开启访问mysql(librdbms)需要在这里配置(hue_safety_valve.ini)

添加配置如下

复制代码
[librdbms]
  # The RDBMS app can have any number of databases configured in the databases
  # section. A database is known by its section name
  # (IE sqlite, mysql, psql, and oracle in the list below).
  [[databases]]
    # mysql, oracle, or postgresql configuration.
    [[[mysql]]]
      # Name to show in the UI.
      nice_name="db_dataone"

      # For MySQL and PostgreSQL, name is the name of the database.
      # For Oracle, Name is instance of the Oracle server. For express edition
      # this is 'xe' by default.
      name=db_dataone

      # Database backend to use. This can be:
      # 1. mysql
      # 2. postgresql
      # 3. oracle
      engine=mysql

      # IP or hostname of the database to connect to.
      host=192.168.0.1

      # Port the database server is listening to. Defaults are:
      # 1. MySQL: 3306
      # 2. PostgreSQL: 5432
      # 3. Oracle Express Edition: 1521
      port=3306

      # Username to authenticate with when connecting to the database.
      user=root

      # Password matching the username to authenticate with when
      # connecting to the database.
      password=123456

      # Database options to send to the server when connecting.
      # https://docs.djangoproject.com/en/1.4/ref/databases/
      ## options={}
复制代码

注意:[[databases]]下可添加多个[[[mysql]]]或其他数据库,如果有多个mysql,分别命名为[[[mysql1]]],[[[mysql2]]]或其他名字区分

 

除此之外,还要添加notebook

复制代码
[notebook]
[[interpreters]]
[[[impala]]]
name=Impala
[[[hive]]]
name=Hive
[[[mysql]]]
name=Mysql
interface=rdbms
[[[java]]]
name=Java
interface=oozie
[[[spark2]]]
name=Spark
interface=oozie
[[[shell]]]
name=Shell
interface=oozie
[[[sqoop1]]]
name=Sqoop1
interface=oozie
[[[distcp]]]
name=Distcp
interface=oozie
复制代码

此处略去了不需要的Pig和MapReduce等;

 

然后重启hue

 

 

 

如果要添加多个mysql,如下配置:

复制代码
[librdbms]
[[databases]]
[[[mysql1]]]
...
[[[mysql2]]]
...
[notebook]
[[interpreters]]
[[[mysql1]]]
...
[[[mysql2]]]
...
复制代码

 

参考:
https://community.cloudera.com/t5/Web-UI-Hue-Beeswax/Hue-db-editor-permissions/td-p/78298
http://cloudera.github.io/hue/docs-4.4.0/user/editor/
http://cloudera.github.io/hue/latest/administrator/configuration/editor/

 

posted @   匠人先生  阅读(1059)  评论(2编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示