1. Configure the database server to support UTF8 by default.

    For MariaDB 10.x and MySQL 5.5.x edit /etc/mysql/my.cnf (or the appropriate my.cnf for your deployment) and add the following lines to the appropriate sections: 

    [client]
    default-character-set = utf8
    
    
    [mysqld]
    character-set-server = utf8
    collation-server = utf8_bin

    Be sure to restart the database server after making any changes.

    For PostgreSQL 9.x the default installation most likely already supports UTF8 and databases will be created using the UTF8 encoding and a suitable collation. You can use the command psql -l to see the existing databases, their encoding, and collation, for example: 

    $ psql -l
                                      List of databases
       Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
    -----------+----------+----------+-------------+-------------+-----------------------
     postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
     template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
               |          |          |             |             | postgres=CTc/postgres
     template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
               |          |          |             |             | postgres=CTc/postgres
    (3 rows)

    If the default encoding and collation does not support UTF8 refer to the documentation on how to use the initdb command to create a new cluster with a default encoding and collation that supports UTF8.

    For either MariaDB, MySQL, or PostgreSQL you may choose to not use UTF8 as the default for all databases and instead use the appropriate commands to create the database used for Grouper specifically to support UTF8. Refer to the documentation for each product for specific details on how to do so.

  2. Create a database user and then the database that Grouper will use. For MariaDB and MySQL: 

    mysql --user=root -p
    CREATE USER 'grouper'@'localhost' IDENTIFIED BY 'some password';
    CREATE DATABASE grouper;
    GRANT ALL ON grouper.* TO 'grouper'@'localhost';
    quit;

    For PostgreSQL:

    createuser --createdb --no-superuser --no-createrole --pwprompt grouper
    Enter password for new role: 
    Enter it again: 
    createdb -O grouper grouper
  3. Verify that the user may connect to the database. For MariaDB and MySQL:

    mysql --user=grouper -p grouper
    quit;

    For PostgreSQL:

    psql -h localhost -U grouper -d grouper
    \q
  • No labels