Using the Liferay Service’s Shell

Sometimes you need direct access to the system to see what’s happening. Kyle wants to use the Liferay service’s shell to view the directory structure and verify database creation.

Here, you’ll use the shell and directly query a Liferay instance’s database from the console.

Accessing the Shell

Access the Liferay service’s shell via the service’s page.

  1. In the Liferay Cloud console, navigate to your UAT environment.

  2. Click Services on the left side of the screen.

  3. Click the Liferay service.

  4. Click the Shell tab.

  5. Enter ls into the shell to see the Liferay Home directory contents.

    Directly read or modify any of the files in your services via the shell, like those in the Liferay Home directory.

note

Changes you make to your Liferay instance through the shell are not permament. They are overwritten the next time your service restarts.

Using the MySQL Client

Next, use the MySQL client to view your Liferay instance’s database.

  1. Enter mysql into the shell to log into the MySQL client with the default user.

    note

    Logging in with the default database user gives read-only access to the database. If you must manipulate data, log in with the database service’s credentials.

  2. Enter show tables; to show a list of all existing tables that you can scroll through.

    Use the show tables MySQL command to see all tables in your Liferay database.

  3. Try running another query to see a list of all vocabularies across all sites:

    select vocabularyId, name, groupId from AssetVocabulary;
    

    You can use the default user to perform any read-only MySQL query, like viewing all vocabularies.

  4. Finally, log out of the MySQL client when you are finished:

    quit
    

Congratulations! You’ve completed the Liferay Cloud Administrator Course.

Back to Courses

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy