ubuntu中用命令创建数据库


# switch to postgres account
sudo su postgres
  
# create a new postgres login: jetty; and set the password to jetty
# since most of our database dump has jetty as the user
createuser -P -d -a -e jetty
#password jetty
 
# create a new postgres login: logintext;
# this is also due to database dump file; SHOULD HAVE DUMP DATABASE WITH -U option;
createuser -P -d -a -e logintext
# create a new empty database
# set the password to jetty (to be consistent with application setting - only for DEV/TESTING)
createdb test -O jetty
  
# grant permission to jetty
psql
#click Enter on keyboard
GRANT all on database test to jetty;
#click Enter on keyboard
\q
#click Enter on keyboard
 
# restore database option1
psql test </tmp/<dumpfile>
 
# restore database option2
psql -d test -t ~/tmp/<dumpfile>
 
# restore database option 3
# psql -d <database> U <username> -f <filename>
psql -d test -U logintest -f demo.test.s83.0.sql
 
# return to your own account
exit

优质内容筛选与推荐>>
1、[暑假集训--数位dp]hdu3709 Balanced Number
2、BWM
3、本地Maven库添加SQLServer2012 sqljdbc4.jar
4、W3a_System Pic
5、Extjs4 文件目录结构


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号