はじめに
未来電子テクノロジーでインターンをしている<@kento_o>です。
前回の記事でVagrantの仮想環境にCentOS7を入れました。
ssh接続+wgetをインストール
まずは、
$ vagrant ssh
でローカルのVagrant+CentOS7の環境に接続します。
その後、
$ rpm -ivh /tmp/wget-1.14-10.el7_0.1.x86_64.rpm
上記のコマンドでwgetをインストールします。
PostgreSQLを導入
wgetを使用して、
$ wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
を導入します。
そして、作成された「postgres」ユーザーにsuコマンドを使用してユーザーを入れ替えます。
データベース確認
$ psql -l
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+---------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)
成功しました!
おわりに
普段何となく使っていたものの意味を考える日々です。