データベース接続エラーが発生する/ Database connection error happens.

■データベース接続エラー時の画面

 

上に示すようなデータベースエラーが発生する場合は以下を確認してください。

  • データベースユーザ名は正しいユーザが指定されていますか?
  • 接続先MySQLサーバ名は正しいですか?
  • パスワードは正しいですか?

データベース(MySQLサーバ)に接続するための情報は,メディアセンター利用登録システム で確認することができます。

なお,HUC13(2020年8月31日以降)では以下の変更点があります。ご注意ください

  1. 個人用のデータベースサービスはMySQLのみの提供です。PostgreSQLは利用できません
  2. MySQLデータベースを利用するには,接続ユーザ名を  アカウント名@home-msql にする必要があります。また,データベースアクセスパスワードを変更している場合は,再設定が必要です

接続ユーザ名の指定場所はアプリケーションにより異なります。一般的なCMS(例:WordPress)の場合は以下の手順で修正します。

  1. FTPソフト等で login.hiroshima-u.ac.jp に接続します
  2. WordPressがインストールされているディレクトリで wp-config.php ファイルを探し,ファイルをエディタ等で開きます(事前にコピーなどでバックアップを取得して下さい)
  3. wp-configの以下の記述部分を修正しファイルを保存します
  4. ページにアクセスし,正常に動作することを確認します
// ** MySQL 設定 - この情報はホスティング先から入手してください。 ** //
/** WordPress のためのデータベース名 */
define( 'DB_NAME', 'データベース名' );

/** MySQL データベースのユーザ名 */
define( 'DB_USER', 'ユーザ名' );    → アカウント名@home-msql を指定

/** MySQL データベースのパスワード */
define( 'DB_PASSWORD', 'パスワード' );

/** MySQL のホスト名 */
define( 'DB_HOST', 'ホスト名' );

/** データベースのテーブルを作成する際のデータベースの文字セット */
define( 'DB_CHARSET', 'utf8mb4' );

/** データベースの照合順序 (ほとんどの場合変更する必要はありません) */
define('DB_COLLATE', '');

---------------------
■Screen in case of database connection errors. 
※See above

If you encounter database errors such as those shown above, check the following 
  ・Is the correct user specified for the database user name? 
  ・Is the name of the MySQL server you are connecting to correct? 
  ・Is the password correct? 
Information for connecting to the database (MySQL server) can be checked on the Media Centre Registration System
Please note that the following changes will be made in HUC13 (after 31 August 2020). Please note the following changes.  

   1. only MySQL database service is available for personal use; PostgreSQL is not available. 
   2. To use the MySQL database, the connection username must be the account name @home-msql. If          the database access password has been changed, it must be reset. 

The location of the connection username depends on the application. For general CMS (e.g. WordPress), follow the steps below. 

1. connect to login.hiroshima-u.ac.jp using FTP software. 
2. Find the wp-config.php file in the directory where WordPress is installed and open the file with an editor. (Make a backup copy of the file in advance.) 
3. modify the following description part of wp-config and save the file. 
4. Access the page and check that it works correctly. 
    // ** MySQL configuration - get this information from your hosting provider. ** // 
    /** Database name for WordPress
   */ define( 'DB_NAME', 'database name' );

   /** User name for MySQL database */ 
   define( 'DB_USER', 'username' ); /** account name
   @home-msql 

   /** MySQL database password */ 
   define( 'DB_PASSWORD', 'password' );

      /** MySQL hostname */ 
   define( 'DB_HOST', 'hostname' );

     /** Database character set when creating database
    tables */ 
    define( 'DB_CHARSET', 'utf8mb4' ); 

    /** databas e collation (most of the time you don't
    need to change it) */ 
    define('DB_COLLATE', ‘’);  

 ・Reference URL
   Editing wp-config.php (WordPress)