centos7 执行一个数据库脚本创建项目中的数据库

[root@localhost ~]# su postgres 切换用户 
bash-4.2$ psql
could not change directory to "/root": Permission denied
psql (9.5.6)
Type "help" for help.

postgres=# psql -Upostgres
postgres-# psql -Upostgres</root/Desktop/db.sql 我的脚本在桌面

==================
[root@localhost dreamstart]# su postgres

bash-4.2$ psql -Upostgres<db.sql
 
 参看http://www.cnblogs.com/Amos-Turing/p/6862253.html
posted @ 2017-07-25 17:47  ldp.im  阅读(794)  评论(0编辑  收藏  举报