Create MySQL Database and User for OCNSSF

  1. Login to the server or machine which has permission to access the SQL nodes of NDB cluster.
  2. Connect to the SQL nodes of NDB cluster one by one.
  3. Login to the MySQL prompt using root permission or user, who has permission to create users with permissions as mentioned below. Example: mysql -h 127.0.0.1 -uroot -p
  4. Check whether OCNSSF network function user already exists. If not exists, create an OCNSSF network function user by executing following queries:
    1. Execute $ SELECT User FROM mysql.user; to list the users.
    2. If user does not exist, create the new user by executing $ CREATE USER '<OCNSSF User Name>'@'%' IDENTIFIED BY '<OCNSSF Password>';

      Example: $ CREATE USER 'nssfusr'@'%' IDENTIFIED BY 'nssfpasswd';

  5. Check OCNSSF network function database already exists. If does not exist, create an OCNSSF network function database and provide permissions to OCNSSF user name created in the previous step:
    1. Execute $ show databases; to check if database exists.
    2. If database does not exists, execute $ CREATE DATABASE IF NOT EXISTS <OCNSSF Database> CHARACTER SET utf8; for Database creation.

      Example:

      $ CREATE DATABASE IF NOT EXISTS nssfdb CHARACTER SET utf8;

    3. Granting permission to user:

      $ GRANT SELECT,INSERT,CREATE,ALTER,DROP,LOCK TABLES,CREATE TEMPORARY TABLES, DELETE,UPDATE,EXECUTE ON <OCNSSF Database>.* TO '<OCNSSF User Name>'@'%';