-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzai-redhatzhong-an-zhuang-postgresql.html
131 lines (118 loc) · 5.31 KB
/
zai-redhatzhong-an-zhuang-postgresql.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="./zai-redhatzhong-an-zhuang-postgresql.html" />
<title> 愚钝的故事 — 在redhat中安装postgresql
</title>
<link rel="stylesheet" href="./theme/css/style.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="author" content="Jet Geng">
<meta name="description" content="安装数据库">
<meta name="tags" contents="sql, ">
</head>
<body>
<header class="header">
<div class="container">
<div class="header-inner">
<h1 class="header-name">
<a class="nodec" href="/">愚钝的故事</a>
</h1>
<h3 class="header-text">Jet Geng的工作和生活</h3>
<ul class="header-menu list-inline">
<li><a class="nodec icon-github" href="https://github.com/jetgeng"></a></li>
</ul>
</div>
</div>
</header> <!-- /.header --> <div class="container">
<div class="post full-post">
<h1 class="post-title">
<a href="/zai-redhatzhong-an-zhuang-postgresql.html" title="Permalink to 在redhat中安装postgresql">在redhat中安装postgresql</a>
</h1>
<ul class="list-inline">
<li class="post-date">
<a class="text-muted" href="/zai-redhatzhong-an-zhuang-postgresql.html" title="2015-04-11T10:20:00+08:00">Sat 11 April 2015</a>
</li>
<li class="muted">·</li>
<li class="post-category">
<a href="./category/database.html">DataBase</a>
</li>
<li class="muted">·</li>
<li>
<a href="/tag/sql.html">sql</a> </li>
<li class="muted">·</li>
<li>
<address class="post-author">
By <a href="./author/jet-geng.html">Jet Geng</a>
</address>
</li>
</ul>
<div class="post-content">
<p>开始 <a class="reference external" href="http://people.planetpostgresql.org/devrim/index.php?/archives/80-Installing-and-configuring-PostgreSQL-9.3-and-9.4-on-RHEL-7.html">http://people.planetpostgresql.org/devrim/index.php?/archives/80-Installing-and-configuring-PostgreSQL-9.3-and-9.4-on-RHEL-7.html</a> 安装数据库。</p>
<p>要注意特定的系统的版本</p>
<p><a class="reference external" href="http://yum.postgresql.org/9.4/redhat/rhel-5.4-x86_64/pgdg-redhat94-9.4-1.noarch.rpm">http://yum.postgresql.org/9.4/redhat/rhel-5.4-x86_64/pgdg-redhat94-9.4-1.noarch.rpm</a></p>
<p>查看linux是32还是64?</p>
<div class="highlight"><pre><span></span>file /bin/ls
</pre></div>
<p>下面去修改/etc/yum.repo.d 中的内容</p>
<div class="highlight"><pre><span></span>sudo yum install postgresql94.x86_64 postgresql94-contrib.x86_64 postgresql94-debuginfo.x86_64 postgresql94-devel.x86_64 postgresql94-docs.x86_64 postgresql94-libs.x86_64 postgresql94-server.x86_64
</pre></div>
<p>/sbin 必须放到path中。</p>
<div class="highlight"><pre><span></span>sudo service postgresql-9.4 initdb //初始化db
sudo service postgresql-9.4 start //启动数据库
<span class="se">\c</span> database_name //切换数据库
</pre></div>
<p>用新用户登录数据库:postgresql Peer authentication failed for user</p>
<p><a class="reference external" href="http://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge">http://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge</a></p>
<p>postgresql 的认证方式有多种方式:</p>
<ol class="arabic simple">
<li>peer登录,这个就是和操作系统的用户一样。</li>
<li>md5 就是通过用户名和密码登录。</li>
</ol>
</div>
</div>
<hr class="separator">
<div class="col-md-8 col-md-offset-2">
<div id="disqus_thread">
<script>
var disqus_shortname = 'techfoolishstory';
(function() {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view the
<a href="https://disqus.com/?ref_noscript=techfoolishstory">
comments powered by Disqus.
</a>
</noscript>
<a href="https://disqus.com" class="dsq-brlink">
blog comments powered by <span class="logo-disqus">Disqus</span>
</a>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="text-center">
Jet Geng, <a href="" target="_blank">版权归Jet Geng所有,转载请注明!</a> unless otherwise noted.
</p>
<div class="text-center">
Generated by <a href="http://getpelican.com" target="_blank">Pelican</a> with the <a href="http://github.com/nairobilug/pelican-alchemy">alchemy</a> theme.
</div>
</div>
</footer> <!-- /.footer -->
<script src="./theme/js/jquery.min.js"></script>
<script src="./theme/js/bootstrap.min.js"></script>
</body> <!-- 42 -->
</html>