设为首页 加入收藏

TOP

PostgreSQL数据库安装部署(五)
2019-06-02 00:12:12 】 浏览:263
Tags:PostgreSQL 数据库 安装 部署
      # begin with 0 to use octal notation
#########################################


  19、创建log目录用于存放开机日志,及启动数据库


[postgres@web1 data]$ mkdir /usr/local/pgsql/log
[postgres@web1 data]$ pg_ctl start -l /usr/local/pgsql-10.5/log/pg_server.log
waiting for server to start.... done
server started
[postgres@web1 data]$


  20、检查是否启动,可以看日志


[postgres@web1 data]$ lsof -i:5432
COMMAND    PID    USER  FD  TYPE DEVICE SIZE/OFF NODE NAME
postgres 25479 postgres    3u  IPv4  50990      0t0  TCP *:postgres (LISTEN)
postgres 25479 postgres    4u  IPv6  50991      0t0  TCP *:postgres (LISTEN)
[postgres@web1 data]$ netstat -lnutp|grep postgres
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:5432            0.0.0.0:*              LISTEN      25479/postgres     
tcp6      0      0 :::5432                :::*                    LISTEN      25479/postgres     
[postgres@web1 data]$ ps -ef|grep postgres
root    24060  1297  0 18:17 pts/0    00:00:00 su postgres
postgres 24061 24060  0 18:17 pts/0    00:00:00 bash
postgres 25479    1  0 18:45 pts/0    00:00:00 /usr/local/pgsql-10.5/bin/postgres
postgres 25481 25479  0 18:45 ?        00:00:00 postgres: checkpointer process 
postgres 25482 25479  0 18:45 ?        00:00:00 postgres: writer process 
postgres 25483 25479  0 18:45 ?        00:00:00 postgres: wal writer process 
postgres 25484 25479  0 18:45 ?        00:00:00 postgres: autovacuum launcher process 
postgres 25485 25479  0 18:45 ?        00:00:00 postgres: stats collector process 
postgres 25486 25479  0 18:45 ?        00:00:00 postgres: bgworker: logical replication launcher 
postgres 25543 24061  0 18:46 pts/0    00:00:00 ps -ef
postgres 25544 24061  0 18:46 pts/0    00:00:00 grep --color=auto postgres
[postgres@web1 data]$


  21、进入库的一些小操作


[postgres@web1 data]$ psql    #进入库
psql (10.5)
Type "help" for help.


postgres=# \password    #设置密码
Enter new password:
Enter it again:
postgres=# CREATE DATABASE name;      #创建库
CREATE DATABASE
postgres=# \du    #查看用户
                                  List of roles
 Role name |                        Attributes                        | Member of
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}


postgres=#
postgres=# \l    #查看数据库列表
          &

首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL中使用group_concat遇到的问.. 下一篇MySQL中group by 与 order by 一..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目