安装成功显示:
Success. You can now start the database server using: /usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start新建迁移目标文件夹
@ubuntu:~$ mkdir /home/postgresql @ubuntu:~$ mkdir /home/postgresql/data修改配置文件:
@ubuntu:~$ su postgresql postgres@ubuntu:~$ vim ~/.profile postgres@ubuntu:~$ psql postgres=# SHOW data_directory; postgres=# ^Z postgres@ubuntu:~$ vi /etc/postgresql/10/main/postgresql.conf postgres@ubuntu:~$ source /etc/profile找到initab位置
postgres@ubuntu:~$ sudo find / -name initdb初始化
postgres@ubuntu:~$ sudo -u postgres /usr/lib/postgresql/10/bin/initdb -D /home/postgresql/data ... ok Success. You can now start the database server using: /usr/lib/postgresql/10/bin/pg_ctl -D /home/postgresql/data -l logfile start