乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      陳鋼的博客 CentOS7下初始化PostgreSQL

       lchjczw 2015-05-18

      CentOS7下初始化PostgreSQL

      2014 年 8 月 27 日

      1、安裝epel;

      1
      rpm -ivh http://mirrors.hustunique.com/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

      或者

      1
      yum install epel-release

      2、安裝postgresql;

      1
      yum install postgresql*

      3、初始化數(shù)據(jù)庫(kù);

      1
      postgresql-setup initdb

      4、啟動(dòng)postgresql并設(shè)置為開機(jī)自啟動(dòng);

      1
      2
      systemctl restart postgresql
      systemctl enable postgresql

      5、登進(jìn)數(shù)據(jù)庫(kù)看看狀態(tài);(可略)

      1
      2
      3
      4
      5
      su - postgres
      psql
      \du (查看角色)
      \l (列出所有數(shù)據(jù)庫(kù))
      \q (退出)

      6、創(chuàng)建角色(postgresql中的用戶)和數(shù)據(jù)庫(kù)實(shí)例;

      1
      2
      3
      su - postgres
      createuser dbuser
      createdb -e -O dbuser dbname

      7、給新用戶設(shè)定密碼

      1
      2
      3
      4
      su - postgres
      psql
      \password dbuser (輸入兩次密碼)
      vim /var/lib/pgsql/data/pg_hba.conf

      在/var/lib/pgsql/data/pg_hba.conf中,將默認(rèn)驗(yàn)證方法

      1
      host    all             all             127.0.0.1/32            ident

      改為密碼驗(yàn)證

      1
      host    all             all             127.0.0.1/32            md5

      8、重啟數(shù)據(jù)庫(kù),讓新的驗(yàn)證方法生效

      1
      systemctl restart postgresql

      9、新用戶登錄數(shù)據(jù)庫(kù);

      1
      psql -U dbuser -d dbname -h 127.0.0.1 (輸入之前的密碼)

      10、玩耍;(以下操作皆在postgresql終端中)

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      \dp (查看當(dāng)前庫(kù)中的表)
      create table test1 (t1 int, t2 varchar(20));
      \dp
      \d test1 (查看表結(jié)構(gòu))
      select * from test1 limit 10;
      insert into test1 (t1,t2) values (11, 'ccccc'), (22, 'aaaa');
      select * from test1 limit 10;
      truncate table test1;
      select * from test1 limit 10;
      drop table test1;
      select * from test1 limit 10;
      \dp


        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多