我要评分
获取效率
正确性
完整性
易理解

Starting, Logging In to, and Stopping PostgreSQL

  • Start the database.
  1. Switch to user postgres.
    su - postgres
  2. Start the database.
    /usr/local/pgsql/bin/pg_ctl -D /data/pgsql/data/ -l logfile start

  3. Check whether the database process is started. If the following information is displayed, the database process is started successfully.

  • Log in to the database.
  1. Switch to user postgres.
    su - postgres
  2. Log in to the database.
    /usr/local/pgsql/bin/psql -U postgres

  • Stop the database.
    1. Switch to user postgres.
      su - postgres
    2. Stop the database.
      /usr/local/pgsql/bin/pg_ctl -D /data/pgsql/data/ -l logfile stop