このコンテンツは選択した言語では利用できません。

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
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat