zoukankan      html  css  js  c++  java
  • postgresql 基础sql

    创建用户和密码:crate user 用户名 with password '密码' ; 创建

            alter user 用户名 with password ’密码' ; 修改用户密码

    查看用户信息: select * from pg_shadow;

    创建库:    create database dbname;

    切换库:   c dbname

    创建表:   create table filename(id,name);

    给用户授权: grant all privileges on databases dbname to username;

    查看所有库:  l

    查看当前库所有表:d

    查看表结构: d filename

    创建数据库并指定所有者: create database dbname owner username;

    查看当前登录用户:select user;

    远程连接数据库:修改pg_hba.conf 和postgresql.conf

          在IPV4 下加一行: host all all 0.0.0.0/24 md5

            上面一行改为:host all all 0.0.0.0/24 trust  

  • 相关阅读:
    jquery operate
    ujs
    图标站
    rails foreign key
    feedback product from uservoice
    秒杀网
    short url
    rails nil blank
    paperclip imagemagic api &paperclip relevent
    类似优米网
  • 原文地址:https://www.cnblogs.com/haoge92/p/9284917.html
Copyright © 2011-2022 走看看