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 装在了虚拟机里,只是因为偶尔还要用网银的缘故. 以我这几年 ...
随机推荐
- Navicat修改mysql表的字符集和排序规则
突然想起前一阵子,在做javaweb后端debug的时候遇到的这个问题.由于在Dao层测试的时候没有尝试过中文的测试例,所以在Service写好后一直不报错但是无法插入数据库. 找了好久才发现是Mys ...
- clion添加ROS环境变量
gedit ~/.local/share/applications/jetbrains-clion.desktop 修改 Exec="/home/cjn/soft-pack/clion-20 ...
- UOJ NOI Round #6
总结 \(\text{Day1}\) 只打了 \(T1\),想正解无果以致于没时间打暴力 \(\text{T1}\) 考虑到最后一个面基者要么落在点上,要么落在边上 所以可以枚举点和边,统计最久的落在 ...
- JZOJ 3570. 【GDKOI2014】壕壕的寒假作业
解析 这道题比较水. 求最快什么时候做完作业? 如果要最快完成第i份作业,那么是i的前继那些作业都要完成之后才能够完成i,所以,为了尽快完成i,我们要把i的前继的作业全部先做完. 最慢什么时候做完作业 ...
- 题解 [ZJOI2010]排列计数
好题. % 你赛考到了不会摆烂,后来发现原来有向下取整,题面没有...( 就算有我也做不出来啦 qAq 首先我们会发现这个长得就是小根堆,答案就变成了小根堆的计数. 首先最小的数字肯定放在根的位置.我 ...
- 通过反射机制简化 JDBC ResultSet 实体类的注入
提出问题 查询完某个表之后,一般都是把结果的每一个字段注入到一个实体类中.比如,数据库 users 表,查询出来的结果注入到 User 实体类中. 通过 while 遍历 ResultSet,把字段对 ...
- Prettier 在 Vite 项目下格式化报错
Prettier 配置文件有很多种格式,有.json..js..yml等.因为 Vite 默认项目用的模块机制是 ES6,我的配置文件又正好是.js,且用的模块机制是 CommonJS.所以就是如上图 ...
- PostgreSQL中的row_number() 与distinct用法说明
一.示例 这两个SQL执行所得到的数据是一样的! select count(s.*) from ( select *, row_number() over (partition by fee_dat ...
- 自定义view,用来测试屏幕
public class BezierGestureTrackView extends View { private Bitmap mBufferBitmap; private Canvas mBuf ...
- mysql查询重复的数据
---查询重复的数据 . UUID可以换成其他的需要去重的字段. 点击查看代码 select * FROM t_gzmx_reptile_receive_incre WHERE id NOT IN ( ...