码迷,mamicode.com
首页 > 数据库 > 详细

REFRESH删除POSTGRESQL

时间:2015-07-13 20:13:13      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

sudo apt-get install python-psycopg2
sudo apt-get install postgresql

sudo su - postgres
createuser --superuser examdatabaseuser
psql
\password examdatabaseuser
createdb examdatabase
\connect examdatabase

初始化阿里云数据盘
fdisk -l
fdisk -S 56 /dev/xvdb
mkfs.ext4 /dev/xvdb1
echo ‘/dev/xvdb1 /mnt ext4 defaults 0 0‘ >> /etc/fstab
cat /etc/fstab
mount -a
df -h

psql
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
COMMENT ON SCHEMA public IS ‘standard public schema‘;

# 大换血
postgres@iZ94x23urx9Z:~$ dropdb examdatabase;
postgres@iZ94x23urx9Z:~$ createdb examdatabase;
postgres@iZ94x23urx9Z:~$ psql
psql (9.3.6)
Type "help" for help.

postgres=# \connect examdatabase
You are now connected to database "examdatabase" as user "postgres".
examdatabase=# \d
No relations found.

REFRESH删除POSTGRESQL

标签:

原文地址:http://www.cnblogs.com/xiangnan/p/4643439.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!