【サーバ】勉強のためサクラVPSを契約して設定した備忘録 MySQL用GUI設定ツール導入(phpMyAdmin)

サーバにphpMyAdminインストール

[html]
yum install phpmyadmin
[/html]

 

パッケージphp-mysqlインストール
PHPからMySQLへアクセスするためパッケージ

[html]
//php-mysqlインストール確認
rpm -q php-mysql
パッケージ php-mysql はインストールされていません。

yum -y install php-mysql ← php-mysqlインストール
[/html]

 

 

 

phpMyAdmin設定

phpMyAdmin.confを編集。
編集の前にバックアップ

[html]
cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.org
vi /etc/httpd/conf.d/phpMyAdmin.conf
[/html]

 

 

編集

[html]
<Directory /usr/share/phpMyAdmin/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
#Order Deny,Allow // コメントアウト
#Deny from All // コメントアウト
#Allow from 127.0.0.1 // コメントアウト
#Allow from ::1 // コメントアウト
Order allow,deny // 追加
Allow from all // 追加
</IfModule>
</Directory>
[/html]

 

 

 

apacheのリスタート

[html]
service httpd restart
[/html]

 

 

 

ブラウザからアクセス

[html]

http://xxx.xxx.xxx.xxx/phpmyadmin/


[/html]