Ubuntu postgres 内网 安装 卸载
# 安装pg,(使用安装包, 不能连接外网)
tar包下载地址 https://www.postgresql.org/ftp/source/v11.1/
放在/home/sxy 目录(随便放)
cd /home/sxy
tar xvzf postg*tar.gz
cd postg*
mkdir /usr/local/pgsql # 安装目录
./configure --prefix=/usr/local/pgsql # 设置配置环境
Ubuntu 16.04报错(联网解决): (cent os 7 没有安装过)
configure: error: readline library not found
解决办法:sudo apt-get install libreadline6-dev
可能其他错误:
configure: error: zlib library not found
apt-get install zlib1g-dev
configure: configure: error: no acceptable C compiler found in $PATH
apt-get install gcc
./configure --prefix=/usr/local/pgsql # 再次配置环境
make && make install # 编译并安装, 出错会退出 (具体问题再baidu)
提示: Postgresql installation complete # 表示安装成功
ls -l /usr/local/pgsql/ # 会有4个目录(bin, include, lib 和 share) # 也说明安装成功
rm -rf /home/sxy/postg*
启动:
root 用户不能启动postgresql # (连接的时候会提示失败)原因baidu
修改密码:
passwd postgres # Ubuntu pg11默认安装了postgres 用户
mkdir -p /var/postgresql/data # 经常变动
初始化:
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
touch /var/postgresql/logfile
chown postgres:postgres /var/postgresql/*
chown postgres:postgres /usr/local/pgsql/*
chmod -R 0700 /var/postgresql/*
修改配置文件:
vim /var/postgresql/data/postgresql.conf
listen_addresses = '*'
port = 5432
max_connections = 2000 # 改大点, 但用的时候还是要创建连接池
vim /var/postgresql/data/pg_hba.conf
添加:
host all all 0.0.0.0/0 md5
# (留下local)其他全注释
修改密码:
passwd postgres
su postgres
/usr/local/pgsql/bin/pg_ctl -D /var/postgresql/data/ -l logfile restart/start/stop # 启动数据库
/usr/local/pgsql/bin/psql -h ip # 本地连接数据库
# 卸载老版本
后补
Ubuntu postgres 内网 安装 卸载的更多相关文章
- CentOS 7 Redis 内网 安装 卸载
# 不能连接外网, 安装Redis服务器的过程 https://redis.io/download (官网下载安装包, 最新版) redis-*.tar.gz 放在安装目录/usr/local/red ...
- Linux anaconda 内网 安装 卸载
安装并不难, 官网介绍的很清楚, 但每次到官网找安装方法不方便,我总结了本文(很全) 官网下载Linux版anaconda, 地址https://www.anaconda.com/download/# ...
- Ubuntu更改源和搜狗输入法安装卸载
安装完Ubuntu 16.04后,要更换为国内的软件源: sudo gedit /etc/apt/sources.list #用文本编辑器打开源列表 在文件开头添加下面的阿里云的软件源: deb ...
- Microsonf visual c++ 14+ 离线内网安装
内网离线安装方法:先下载官方的visualcppbuildtools: <br href=http://go.microsoft.com/fwlink/?LinkId=691126 >& ...
- 内网安装python第三方包
内网快速安装python第三方包 内网安装包是一个很麻烦的问题,很多时候,内网的源会出现问题,导致无法安装. 这里给出一种快速在内网中安装第三方包,无需使用内网的源. 外网操作 1.根据开发环境下的所 ...
- k8s内网安装部署(二)
续上篇 https://www.cnblogs.com/wangql/p/13397034.html 一.kubeadm安装 1.kube-proxy开启ipvs的前置条件 modprobe br_n ...
- 内网安装ubuntu包
到http://packages.ubuntu.com搜索包下载下来, 再安装.
- redhat 7.2 内网安装docker
本文介绍在内网环境下如果通过网络代理映射来完成docekr的安装,首先在能上网的windows机器上安装squid,并启动,本实例中windows机器IP为 192.168.192.101 ,squi ...
- ubuntu lamnp 环境的安装/卸载 及 配置
安装mysql--------------------------------------sudo apt install mysql-server #5.7版本 安装php----------- ...
随机推荐
- OpenResty 最佳实践 lua与nginx的结合 --引用自https://moonbingbing.gitbooks.io/openresty-best-practices/content/
系统的说明了lua在nginx上的开发 请大家到源址查看 OpenResty最佳实践
- DataSource - 常用数据库连接池 (DBCP、c3p0、Druid) 配置说明
1. 引言 1.1 定义 数据库连接是一种关键的有限的昂贵的资源,这一点在多用户的网页应用程序中体现得尤为突出.对数据库连接的管理能显著影响到整个应用程序的伸缩性和健壮性,影响到程序的性能指标.数据库 ...
- SpringBoot Web开发(4) Thymeleaf模板与freemaker
SpringBoot Web开发(4) Thymeleaf模板与freemaker 一.模板引擎 常用得模板引擎有JSP.Velocity.Freemarker.Thymeleaf SpringBoo ...
- 1T硬盘获3T体验 彻底解决NVR存储时间短的问题
随着高清技术的进步,现在300W和400W的IPC越来越普及,但同时带来了更多的成本及存储便利问题.“硬盘存了7天就满了”.“同样大小的硬盘,存储时间越来越短”......为啥你的NVR不能存更长的时 ...
- UE4 UMG
转自:https://www.cnblogs.com/kadaj/p/6412937.html 1.创建关卡类 1.创建C++类继承LevelScriptActor 2.打开关卡蓝图 Class Se ...
- Oracle创建pfile spfile 文件及其恢复
1.Oralce在启动实例的时读取$ORACLE_HOME/dbs下面的初始化文件.初始化文件分为:A.静态参数文件PFILE,一般名为initSID.oraB.永久参数文件SPFILE,一般名为sp ...
- IO密集型和计算密集型
我们常说的多任务或者单任务分为两种: IO密集型的任务 计算密集型的任务 IO密集型的任务或:有阻塞的状态,就是不一直会运行CPU(中间就一个等待状态,就告诉CPU 等待状态,这个就叫IO密集型 ...
- python 优先队列
python 优先队列 from queue import PriorityQueue q = PriorityQueue() q.put((2, 'code')) q.put((1, 'eat')) ...
- 关于six.with_metaclass(ABCMeta, object)的理解
在学习Python过程中,看到了生成虚基类的方式, class PeopleBase(six.with_metaclass(ABCMeta, object)): @abstractmethod def ...
- JavaScript: RegExp check UserName
Function : We can use regular expressions to check user input data formats. Homework: Check user inp ...