CentOS 7 PostgreSQL ¼³Ä¡ ¹× »ç¿ë¹ý

   Á¶È¸ 14119   Ãßõ 0    

https://www.ehostidc.co.kr/hosting/domestic.php (446)
https://www.ehostidc.co.kr/colocation/colocation.php (545)



 

1) PostgreSQL 설치

[root@master ~]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat- 

[root@master ~]# yum install postgresql11-server postgresql11-contrib


2) postsql 실행

[root@master ~]# /usr/pgsql-11/bin/postgresql-11-setup initdb

[root@master ~]# systemctl start postgresql-11

[root@master ~]# systemctl enable postgresql-11


3) postgresql 로컬 접속

[root@master ~]# su – postgres  *PostgreSql 설치시 자동 생성되는 계정

-bash-4.2$ psql

postgres=# \q  *PostgreSql 접속 종료


4) databases 확인 및 신규 데이터베이스 생성

postgres=# \l

postgres=# create database [DB Name];


5) table  생성

postgres=# CREATE TABLE [데이터베이스명]( title varchar(256) NOT NULL, contents varchar NOT NULL, date date NOT NULL, name varchar(20) NOT NULL );

postgres=# \dt


6) 사용자 계정 생성

postgres=# select * from pg_user; 

postgres=# CREATE USER [사용자명] PASSWORD '[비밀번호]';

postgres=# select * from pg_user; 


7) 사용자 계정 권한 추가

postgres=# alter role [사용자명] [추가 권한];

postgres=# \du  *사용자명 및 권한 확인



 

https://www.aiocp.co.kr/ ( 딥러닝,머신러닝 서버 판매 ,컨설팅) https://bigbangcloud.co.kr/ ( GPU 클라우드 서비스) ::: AI 서버의 모든것 ::: 인공지능의 시작~ (주)이호스트ICT


Á¦¸ñPage 8/28
2015-09   28882   ÀÓÁø¿í
2016-12   28766   ¹éµÎ¼º
2016-08   28524   ¹Ì³ª¸®³ª¹°
2022-06   28451   µö·¯´×¼­¹ö
2017-07   28189   ¼¼¹ú½­
2014-06   27896   witbox
2016-11   27457   witbox
2022-05   27417   dadami
2016-08   27262   Å°³×½Ã½º
2016-07   27229   ¹«¾Æ
2011-11   27046   ¹Ú
2015-01   26987   ȲÁø¿ì
2014-04   26914   dydans
02-08   26708   µö·¯´×¼­¹ö
2015-09   26627   ÁÒ¯
2022-08   26546   ÄíÀö
2022-08   26498   ¹Ú¹®Çü
2019-04   26395   ÇÁ·Î½Ã¾Æ
2015-06   26210   stone92±è°æ¹Î
2023-03   26122   oht993