PostgreSQL-14 安装配置-wsl_v1_ubuntu22.04
环境准备
pgAdmin: Cisco2022
postgrep数据库:
postgres: Postgres_2023
install
https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-database
Update your Ubuntu packages: sudo apt update
Once the packages have updated, install PostgreSQL (and the -contrib package which has some helpful utilities) with: sudo apt install postgresql postgresql-contrib
Confirm installation and get the version number: psql --version
There are 3 commands you need to know once PostgreSQL is installed:
sudo service postgresql status for checking the status of your database.
sudo service postgresql start to start running your database.
sudo service postgresql stop to stop running your database.
The default admin user, postgres, needs a password assigned in order to connect to a database. To set a password:
Enter the command: sudo passwd postgres
You will get a prompt to enter your new password.
Close and reopen your terminal.
To run PostgreSQL with psql shell:
Start your postgres service: sudo service postgresql start
Connect to the postgres service and open the psql shell: sudo -u postgres psql
Once you have successfully entered the psql shell, you will see your command line change to look like this: postgres=#
To see what user accounts have been created on your PostgreSQL installation, use from your WSL terminal: psql -c "\du" ...or just \du if you have the psql shell open
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
配置远程访问
vim /etc/postgresql/14/main/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
host all all 0.0.0.0/0 md5 # 这行是新增的
修改后 重启服务生效
添加用户并授权远程访问
# 切换成postgres用户
su postgres
# 链接数据库
psql
# 创建数据库用户
create user liam with password 'Liam2022';
# 创建数据库
create database liam_db owner liam;
# 授权
grant all privileges on database liam_db to liam;
# 创建superuser
create user leiwang6 password 'Leiwang6' superuser createrole createdb REPLICATION;
PostgreSQL-14 安装配置-wsl_v1_ubuntu22.04的更多相关文章
- Ubuntu20.04 PostgreSQL 14 安装配置记录
PostgreSQL 名称来源 It was originally named POSTGRES, referring to its origins as a successor to the Ing ...
- mysql 5.7.14 安装配置方法图文教程(转)
http://www.jb51.net/article/90259.htm ******************************** 因笔者个人需要需要在本机安装Mysql,先将安装过程记录如 ...
- Caffe学习系列(1):安装配置ubuntu14.04+cuda7.5+caffe+cudnn
一.版本 linux系统:Ubuntu 14.04 (64位) 显卡:Nvidia K20c cuda: cuda_7.5.18_linux.run cudnn: cudnn-7.0-linux-x6 ...
- Kubernetes及Dashboard详细安装配置(Ubuntu14.04)
前些日子部门计划搞并行开发,需要对开发及测试环境进行隔离,所以打算用kubernetes对docker容器进行版本管理,搭建了下Kubernetes集群,过程如下: 本流程使用了阿里云加速器,配置流程 ...
- Mysql5.7.14安装配置
Mysql5.7.14免安装版配置方法: 运行 在命令行中输入 mysqld install mysql5.7 安装成功后,启动mysql 在命令行中输入 net start mysql5.7 这个时 ...
- postgresql+slony-i安装配置主从
slon软件下载地址:slony1-1.2.6 http://slony.info/downloads/1.2/source/ postgresql下载地址: http://www.postgresq ...
- CentOS下Redis 2.2.14安装配置详解(转载)
一. 下载redis最新版本2.2.14 cd /usr/local/src wget –c http://redis.googlecode.com/files/redis-2.2.14.tar.gz ...
- Hadoop安装配置(ubuntu-12.04.2-server-amd64)
环境如下: ubuntu-12.04.2-server-amd64 hadoop-1.0.4 VirtualBox 1.在VBox中安装Ubuntu Server,用户名和密码都是hadoop,安装完 ...
- mysql 5.7以上版本安装配置方法图文教程(mysql 5.7.12\mysql 5.7.13\mysql 5.7.14)(转)
http://www.jb51.net/article/90302.htm ******************************* 这篇文章主要为大家分享了MySQL 5.7以上缩版本安装配置 ...
- Ubuntu 14.04 安装配置备忘录
完全在 Linux 下工作,大概有3年时间了. 之前都是用 Windows, 而把 Linux 装在虚拟机里,现在反过来,把 Windows 装在了虚拟机里,只是因为偶尔还要用网银的缘故. 以我这几年 ...
随机推荐
- The Missing Semester - 第二讲 学习笔记
第二讲 Shell 工具和脚本 课程视频地址: https://www.bilibili.com/video/BV1Vv411v7FR 本机学习使用平台:虚拟机ubuntu18.04.6 主题一:Sh ...
- golang拾遗:实现一个不可复制类型
这是golang拾遗系列的第六篇.这个系列主要用来记录一些平时不常见的知识点,偶尔也会实现些有意思的小功能,比如这篇. golang拾遗系列目录: golang拾遗:指针和接口 golang拾遗:为什 ...
- 【KAWAKO】TVM-使用c++进行推理
目录 前言 修改cpp_deploy.cc文件 修改DeployGraphExecutor()函数 numpy与bin文件的互相转换 numpy转bin bin转numpy 使用CMakeLists. ...
- 【KAWAKO】iphone13pro开箱流程
目录 全程录像 检查包装盒 检查包装盒内物品 检查各种码 拆封 激活 激活之后 检查屏幕 检查其它功能 贴膜(选) References 全程录像 如果你觉得你所购买的平台 (比如某ABB格式名字的平 ...
- java环境变量配置-最新版
安装 百度"java下载"进入官网下载最新版,闭着眼睛安装: 配置jre 因java11以上不自带jre,需要我们自己配置,配置如下: # 终端进入jdk所在的目录后执行 bin\ ...
- PPMM
代码 #include<cstdio> using namespace std; const int N = 1000000 , INF = 2e9; int n , m , x , he ...
- Java开发中要避免的坑和一些代码优化技巧
1:动态SQL遇到的坑,先看下面OGNL表达式的说明. Any object can be used where a boolean is required. OGNL interprets obje ...
- OpenLayers入门练习
一.实验内容 练习OpenLayers的引用形式; 简单地图加载; 控件加载. 二.实验步骤 2.1 ol引用 <!doctype html> <html lang="zh ...
- js中各种事件监听
html.push('<input type="button" id="autocount_' + sysTime + '" class="la ...
- 实践:腾讯云IM搭建应用内类微信社交聊天模块
社交模块是目前主流应用程序最常见的功能之一.有了社交模块,用户在您的应用内,可以自由的交流互动,并添加好友,关注其他用户等等.这可在很大程度上,促进您应用程序的活跃度,吸引用户留存,获取更多新用户,并 ...