質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Amazon RDS

Amazon RDSは、米アマゾン社が提供しているRDBMSサービス。クラウド上でのリレーショナルデータベースの構築および運用が可能です。MySQL/PostgreSQL/Oracle/SQL Serverのインストールを容易にすることができます。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

2568閲覧

phpmyadminでec2(centos)からRDSデータベースを閲覧しようとするとmysqli_real_connect(): (HY000/2002): No such file と言われる

htkhtk

総合スコア8

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Amazon RDS

Amazon RDSは、米アマゾン社が提供しているRDBMSサービス。クラウド上でのリレーショナルデータベースの構築および運用が可能です。MySQL/PostgreSQL/Oracle/SQL Serverのインストールを容易にすることができます。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2020/04/08 07:40

前提・実現したいこと

EC2(CentOS)インスタンスにphpMyAdminをインストールし、RDSのデータベースを閲覧できるようにしたい。

発生している問題・エラーメッセージ

rootユーザーでログインしようとすると以下のように返される。パスワードに誤りはない。
イメージ説明

該当のソースコード

ディレクトリ構成 `-- phpmyadmin |-- CODE_OF_CONDUCT.md |-- CONTRIBUTING.md |-- ChangeLog |-- DCO |-- LICENSE |-- README |-- RELEASE-DATE-4.8.5 |-- ajax.php |-- browse_foreigners.php |-- changelog.php |-- chk_rel.php |-- composer.json |-- composer.lock |-- config.sample.inc.php |-- db_central_columns.php |-- db_datadict.php |-- db_designer.php |-- db_events.php |-- db_export.php |-- db_import.php |-- db_multi_table_query.php |-- db_operations.php |-- db_qbe.php |-- db_routines.php |-- db_search.php |-- db_sql.php |-- db_sql_autocomplete.php |-- db_sql_format.php |-- db_structure.php |-- db_tracking.php |-- db_triggers.php |-- doc |-- error_report.php |-- examples |-- export.php |-- favicon.ico |-- gis_data_editor.php |-- import.php |-- import_status.php |-- index.php |-- js |-- libraries |-- license.php |-- lint.php |-- locale |-- logout.php |-- navigation.php |-- normalization.php |-- package.json |-- phpcs.xml.dist |-- phpinfo.php |-- phpmyadmin.css.php |-- prefs_forms.php |-- prefs_manage.php |-- prefs_twofactor.php |-- print.css |-- robots.txt |-- schema_export.php |-- server_binlog.php |-- server_collations.php |-- server_databases.php |-- server_engines.php |-- server_export.php |-- server_import.php |-- server_plugins.php |-- server_privileges.php |-- server_replication.php |-- server_sql.php |-- server_status.php |-- server_status_advisor.php |-- server_status_monitor.php |-- server_status_processes.php |-- server_status_queries.php |-- server_status_variables.php |-- server_user_groups.php |-- server_variables.php |-- setup |-- show_config_errors.php |-- sql |-- sql.php |-- tbl_addfield.php |-- tbl_change.php |-- tbl_chart.php |-- tbl_create.php |-- tbl_export.php |-- tbl_find_replace.php |-- tbl_get_field.php |-- tbl_gis_visualization.php |-- tbl_import.php |-- tbl_indexes.php |-- tbl_operations.php |-- tbl_recent_favorite.php |-- tbl_relation.php |-- tbl_replace.php |-- tbl_row_action.php |-- tbl_select.php |-- tbl_sql.php |-- tbl_structure.php |-- tbl_tracking.php |-- tbl_triggers.php |-- tbl_zoom_select.php |-- templates |-- themes |-- themes.php |-- tmp |-- transformation_overview.php |-- transformation_wrapper.php |-- url.php |-- user_password.php |-- vendor |-- version_check.php |-- view_create.php |-- view_operations.php `-- yarn.lock

phpmyadmin/config.sample.inc.php

php

1<?php 2/* vim: set expandtab sw=4 ts=4 sts=4: */ 3/** 4 * phpMyAdmin sample configuration, you can use it as base for 5 * manual configuration. For easier setup you can use setup/ 6 * 7 * All directives are explained in documentation in the doc/ folder 8 * or at <https://docs.phpmyadmin.net/>. 9 * 10 * @package PhpMyAdmin 11 */ 12 13/** 14 * This is needed for cookie based authentication to encrypt password in 15 * cookie. Needs to be 32 chars long. 16 */ 17$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 18 19/** 20 * Servers configuration 21 */ 22$i = 0; 23 24/** 25 * First server 26 */ 27$i++; 28/* Authentication type */ 29$cfg['Servers'][$i]['auth_type'] = 'cookie'; 30/* Server parameters */ 31$cfg['Servers'][$i]['host'] = 'RDSエンドポイント'; 32$cfg['Servers'][$i]['compress'] = false; 33$cfg['Servers'][$i]['AllowNoPassword'] = false; 34 35/** 36 * phpMyAdmin configuration storage settings. 37 */ 38 39/* User used to manipulate with storage */ 40// $cfg['Servers'][$i]['controlhost'] = ''; 41// $cfg['Servers'][$i]['controlport'] = ''; 42// $cfg['Servers'][$i]['controluser'] = 'pma'; 43// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; 44 45/* Storage database and tables */ 46// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 47// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; 48// $cfg['Servers'][$i]['relation'] = 'pma__relation'; 49// $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; 50// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; 51// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; 52// $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; 53// $cfg['Servers'][$i]['history'] = 'pma__history'; 54// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; 55// $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; 56// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; 57// $cfg['Servers'][$i]['recent'] = 'pma__recent'; 58// $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; 59// $cfg['Servers'][$i]['users'] = 'pma__users'; 60// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; 61// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; 62// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; 63// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; 64// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; 65// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; 66 67/** 68 * End of servers configuration 69 */ 70 71/** 72 * Directories for saving/loading files from server 73 */ 74$cfg['UploadDir'] = ''; 75$cfg['SaveDir'] = ''; 76 77/** 78 * Whether to display icons or text or both icons and text in table row 79 * action segment. Value can be either of 'icons', 'text' or 'both'. 80 * default = 'both' 81 */ 82//$cfg['RowActionType'] = 'icons'; 83 84/** 85 * Defines whether a user should be displayed a "show all (records)" 86 * button in browse mode or not. 87 * default = false 88 */ 89//$cfg['ShowAll'] = true; 90 91/** 92 * Number of rows displayed when browsing a result set. If the result 93 * set contains more rows, "Previous" and "Next". 94 * Possible values: 25, 50, 100, 250, 500 95 * default = 25 96 */ 97//$cfg['MaxRows'] = 50; 98 99/** 100 * Disallow editing of binary fields 101 * valid values are: 102 * false allow editing 103 * 'blob' allow editing except for BLOB fields 104 * 'noblob' disallow editing except for BLOB fields 105 * 'all' disallow editing 106 * default = 'blob' 107 */ 108//$cfg['ProtectBinary'] = false; 109 110/** 111 * Default language to use, if not browser-defined or user-defined 112 * (you find all languages in the locale folder) 113 * uncomment the desired line: 114 * default = 'en' 115 */ 116//$cfg['DefaultLang'] = 'en'; 117//$cfg['DefaultLang'] = 'de'; 118 119/** 120 * How many columns should be used for table display of a database? 121 * (a value larger than 1 results in some information being hidden) 122 * default = 1 123 */ 124//$cfg['PropertiesNumColumns'] = 2; 125 126/** 127 * Set to true if you want DB-based query history.If false, this utilizes 128 * JS-routines to display query history (lost by window close) 129 * 130 * This requires configuration storage enabled, see above. 131 * default = false 132 */ 133//$cfg['QueryHistoryDB'] = true; 134 135/** 136 * When using DB-based query history, how many entries should be kept? 137 * default = 25 138 */ 139//$cfg['QueryHistoryMax'] = 100; 140 141/** 142 * Whether or not to query the user before sending the error report to 143 * the phpMyAdmin team when a JavaScript error occurs 144 * 145 * Available options 146 * ('ask' | 'always' | 'never') 147 * default = 'ask' 148 */ 149//$cfg['SendErrorReports'] = 'always'; 150 151/** 152 * You can find more configuration options in the documentation 153 * in the doc/ folder or at <https://docs.phpmyadmin.net/>. 154 */

自分で調べたことや試したこと

  • phpMyAdmin/config.inc.phpを変更するようにググると出てくるのですがそのようなファイルが見当たらず、内容的にそれっぽいphpmyadmin/config.sample.inc.phpを編集している。
  • $cfg['Servers'][$i]['host'] = 'localhost'をRDSエンドポイントに変更した。

使っているツールのバージョンなど補足情報

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yoorwm

2020/04/08 07:47

phpmyadmin/config.sample.inc.phpを編集して、ファイル名そのままですか? サンプルファイルなので、config.inc.phpにリネームして編集してどうなりますか?
htkhtk

2020/04/08 08:07

ありがとうございます!いけました!
guest

回答1

0

自己解決

# cp config.sample.inc.php ./config.inc.php
サンプルファイルなのでリネームすると適用されました。
ありがとうございました。

投稿2020/04/08 08:10

htkhtk

総合スコア8

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問