作者:速度coinmer | 来源:互联网 | 2023-10-11 00:41
数据库|mysql教程postgresql,安装,配置,简单,操作,postgre数据库-mysql教程秒赞源码可用,vscode代码格式话,ubuntu怎么装机,tomcat限制
数据库|mysql教程
postgresql,安装,配置,简单,操作,postgre
数据库-mysql教程
秒赞源码可用,vscode 代码格式话,ubuntu怎么装机,tomcat限制地址登录,sqlite数据类型对照表,爬虫操作,php sql查询语句,短视频如何优化seo,网站搬家步骤,qq 模板lzw
postgresql安装配置简单操作 1、下载postgresql最新版: http://www.postgresql.org/ftp/source/ 2、解压文件: www.2cto.com tar zxvf postgresql-8.3.7.tar.gz cd postgresql-8.3.7 3、配置: ./configure –prefix=/usr/local/pgsql 4、编译: make 5、安
五折卡开源解密源码,vscode优化vue代码插件,ubuntu安装 联网,tomcat 网页打不开,游走爬虫技术,exec php 安全,荆门本地seo推广公司排名,网站平台代码,适合文章发布的discuz模板lzw
企业源码带数据,ubuntu 直接装系统,怎么看tomcat启动了,使用爬虫的作用,php时区差8小时,seo公司 排名lzw
postgresql安装配置简单操作
1、下载postgresql最新版:
http://www.postgresql.org/ftp/source/
2、解压文件: www.2cto.com
tar zxvf postgresql-8.3.7.tar.gz
cd postgresql-8.3.7
3、配置:
./configure –prefix=/usr/local/pgsql
4、编译:
make
5、安装:
make install
6、创建用户组和用户:
groupadd postgres
useradd -g postgres postgres
7、创建数据库库文件存储目录、给postgres赋予权限:
mkdir /usr/local/pgsql/data
cd /usr/local/pgsql
chown postgres.postgres data
8、初始化数据库目录:
切换用户
su – postgresql
www.2cto.com
初始化数据
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
启动数据库
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
9、配置监听地址和端口:
vi /usr/local/pgsql/data/postgresql.conf
取消以下两行的注释
listen_addresses = ‘*’
port = 5432
10、允许远程连接:
vi /usr/local/pgsql/data/pg_hba.conf
添加
host all all 192.168.1.0/24 trust
每项的具体意思在配置文件中有详细说明
配置iptables让远程主机能访问:
vi /etc/sysconfig
添加
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5432 -j ACCEPT
service iptables restart
www.2cto.com
11、让postgresql数据库随系统启动而启动:
将启动脚本拷贝到/etc/init.d/目录下,具体执行如下命令:
cd /etc/rc.d/init.d
cp (第一步解压的安装文件目录)/postgresql-8.3.7/contrib/start-scripts/linux postgresql
chmod +x postgresql
vi postgresql
prefix=/usr/local/pgsql
PGDATA=”/usr/local/pgsql/data”
PGUSER=postgres
PGLOG=”/var/log/pgsql.log”
chkconfig –add postgresql
启动数据库:
service postgresql start