Non-Ambari Cluster Installation Guide
Also available as:
PDF
loading table of contents...

Using Hue with MySQL

To set up Hue to use a MySQL database:

  1. Create a new user in MySQL, and grant privileges to it to manage the database using the MySQL database admin utility:

    # mysql -u root -p
    <CREATE USER $HUEUSER IDENTIFIED BY '$HUEPASSWORD';
    GRANT ALL PRIVILEGES on *.* to ‘$HUEUSER’@’localhost’ WITH GRANT OPTION;
    GRANT ALL on $HUEUSER.* to ‘$HUEUSER’@’localhost’ IDENTIFIED BY 
    $HUEPASSWORD;
    FLUSH PRIVILEGES;
  2. Create the MySQL database for Hue:

    # mysql -u root -p
    CREATE DATABASE $DBNAME;
  3. Open the /etc/hue/conf/hue.ini file and edit the [[database]] section:

    [[database]]
    engine=mysql
    host=$DATABASEIPADDRESSORHOSTNAME
    port=$PORT
    user=$HUEUSER
    password=$HUEPASSWORD
    name=$DBNAME
  4. Synchronize Hue with the external database to create the schema and load the data.

    cd /usr/lib/hue
    source build/env/bin/activate
    hue syncdb --noinput
    Hue migrate
    deactivate