The new docs.trellix.com features a modernized UI and AI-powered conversational search. Content is currently available in English, with additional languages launching in early November 2026. We hope you enjoy the updated experience.

Create a database user in an MLOS system

Prev Next

To create a database user for accessing the Manager database on an MLOS system, perform the following steps:

  1. If you are using Manager version 10.1.7.4 or earlier -

    Run the following commands to create a new database user.

    1. Login to the Manager instance.

    2. Switch to the restricted shell.

      To switch to the restricted shell, use the 5n3ak1n command. After running the command, it will prompt for the root password followed by the admin password.

    3. Enable listening on port 3306.

      #firewall-cmd --zone=public --permanent --add-port=3306/tcp

      #firewall-cmd --reload

    4. Comment the bind-address and the skip-networking properties in the /etc/my.cnf file.

      #bind-address=127.0.0.1
      #skip-networking
    5. Restart the mysql service.

      #systemctl restart mysqld

    6. Login to MariaDB as a root user.

      #<Manager_Install_Dir>/MariaDB/bin/mysql -u root -p

      Running this command will prompt you to enter the root password of the database. On successful login, you will get the MariaDB prompt and in the prompt, run the use mysql; command.

    7. Create the required database user.

      >create user <new user name of the database>@<IP address of the system from which the user will connect to the database> identified by '<password>';

      For example: >create user ipstst@192.168.1.20 identified by 'ipstp';

    8. Provide read only access to the newly created database user.

      >grant select on lf.* to ipstst@192.168.1.20;

    9. Verify if the creation of the database user is successful.

      SELECT User FROM mysql.user;

  2. If you are using Manager version 10.1.7.7 or later -

    Run the following commands to create a new database user.

    1. Login to the Manager Shell.

    2. Execute the command dbShell. Enter the DB username and password, when prompted.

      The prompt changes to Please enter the SQL query you want to execute: when you successfully login to the dbShell.

    3. Create the required database user.

      CREATE USER '<username>'@'<hostname>' IDENTIFIED BY '<password>';

      For example: >CREATE USER user1@localhost IDENTIFIED BY 'test123'; where user1 is the name of the user being created, hostname is localhost, and password provided is test123.

      Note

      The default hostname is localhost.

    4. Grant required permission(s) to the user.

      GRANT priv_type ON priv_level TO 'username'@'hostname';

      Replace priv_type with the type of privilege (such as, SELECT, INSERT, UPDATE, or ALL) you want to grant to the user, priv_level with the level at which the privilege should apply (that is, database.table), and username and hostname with the values you used in the CREATE USER statement.

      For example: GRANT SELECT ON testdb1.* TO user1@localhost, where read-only access is provided to user1 in the database named testdb1.

    5. Flush privileges so that the user permissions can take effect.

      FLUSH PRIVILEGES;

    6. Verify if the creation of the database user is successful.

      SELECT User FROM mysql.user;

    7. Execute the command exit to exit the dbShell prompt.