Este contenido no está disponible en el idioma seleccionado.

11.9.4. Accessing a Database Cartridge


The integrity of a database is verified by connecting to an application using SSH and running the shell for the database cartridge. A successful connection to the database shell indicates that the database has been created correctly.
The shell for each database also offers a selection of management commands. See the appropriate database documentation for more information on the available database shell commands.

Important

Although accessing applications with the shell environment provides advanced operations, accidental damage to your application can occur. Therefore, Red Hat recommends to use shell access only when necessary.

Procedure 11.3. To Manage a Database in a Shell Environment:

  1. Access the desired application in a shell environment with the following command:
    $ rhc ssh App_Namerhc ssh App_Name
    Copy to Clipboard Toggle word wrap
  2. From the application's shell environment prompt, run the appropriate command for the database to access the interactive database shell:
    • Run the mysql command to access the MySQL shell.
    • Run the psql command to access the PostgreSQL shell.
    • Run the mongo command to access the MongoDB shell.

    Example 11.12. Accessing a MySQL Shell

    [racer-automobile.example.com 515e21acdbd93c051d000022]\> mysql
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1
    Server version: 5.1.71 Source distribution
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>
    Copy to Clipboard Toggle word wrap

Note

Since OpenShift Enterprise does not allow editing MySQL server configuration, it may be necessary to specify certain settings in the client connection string. For example, the default character set is Latin-1. If you would like to use UTF-8 instead, set the character set and collation as parameters on the connection string. For example, in a Java EE application, the URL would be specified in persistence.xml like:
<connection-url>jdbc:mysql://xxx.x.xxx.xxx:xxxx/databaseName?useUnicode=yes&amp;characterEncoding=UTF-8</connection-url>
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat