6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

phpMyAdmin インストールメモ

Posted at

phpMyAdminを入れるときよく忘れるのでメモ

phpMyAdminの設定(パスワードとか)は範囲外。
インストール中にパスワードを設定するが全て統一して登録したので注意。

環境

  • Ubuntu 16.04
  • Mysql 7.0
  • Apache/2.4.18 (Ubuntu)
  • PHP 7.0.30

phpMyAdmin インストール準備

ApacheとPHPを入れる

$ sudo apt update
$ sudo apt install -y apache2
$ sudo apt install -y php php-mysql libapache2-mod-php
$ sudo systemctl apache2 restart

とりあえず/var/www/html/phpinfo.phpを作成して
__http://localhost/phpinfo.php__に接続できるか確認。

<!-- phpinfo.phpの中身 -->

<?php phpinfo();

mySqlを入れる

$ sudo apt install mysql-server
## パスワードを設定

mySqlに入れるか確認。

mysql -uroot もしくは mysql -uroot -p

phpMyAdmin インストール

本題。

$ sudo add-apt-repository ppa:nijel/phpmyadmin
$ sudo apt update
$ sudo apt install phpmyadmin
# 全て[yes]、パスワードを設定

インストールが終わったらapacheに認識させる。

$ sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
$ sudo a2enconf phpmyadmin
$ sudo systemctl restart apache2

__http://localhost/phpmyadmin__で入れれば完了。

apache conf-availableとconf-enabled

conf-enabledapache.confを持ってけばいいでしょと思ったけど、
基本動作はconf-availableにコピー、リンクを作成し、a2enconfコマンドで有効にするらしい。
conf-enabledに直接コピー、リンクを貼っても動くには動く。

conf-available: this directory contains available configuration files. All files that were >previously in /etc/apache2/conf.d should be moved to /etc/apache2/conf-available.

conf-enabled: holds symlinks to the files in /etc/apache2/conf-available. When a configuration file >is symlinked, it will be enabled the next time apache2 is restarted.

参考:https://help.ubuntu.com/lts/serverguide/httpd.html

6
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?