Creating the Hue database

Hue requires a SQL database to store small amounts of data, including user account information as well as the history of queries and sharing permissions. You must create a database for Hue with UTF-8 character set and grant user privileges.

  1. SSH into the database server host as the root user.
  2. Create a database for Hue with UTF-8 collation and grant user privileges:
    CREATE DATABASE [***HUE-DATABASE-NAME***] DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
    GRANT ALL ON [***HUE-DATABASE-NAME***].* TO '[***HUE-DATABASE-NAME***]'@'%' IDENTIFIED BY '[***PASSWORD***]';
    Replace [***HUE-DATABASE-NAME***] with the actual Hue database name such as "hue".
    Ensure Hue uses UTF-8 collation and character set.
    # To create (use utf8_general_ci or utf8mb4_general_ci):
    CREATE DATABASE [***HUE-DATABASE-NAME***] COLLATE = 'utf8_general_ci';
    
    # To view default_character_set_name and default_collation_name
    SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
    
    # To alter if not created with UTF8 collation
    ALTER DATABASE [***HUE-DATABASE-NAME***] COLLATE = 'utf8_general_ci';
  3. Verify the connection to the Hue database by running the following command:
    mysql -u [***HUE-DATABASE-NAME***] -p
    Enter password: [***PASSWORD***]