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 装在了虚拟机里,只是因为偶尔还要用网银的缘故. 以我这几年 ...
随机推荐
- lua 控制语句
for循环 模式1 for k,v in f, data, init_k do end 进行的操作是 f(data, old_k), 例如f(data, init_k) 渴望返回的是 new_k, v ...
- Vue3
VUE.3 1.前端工程化: 小白视角 会写HTML. css.JavaScript就会前端开发 需要美化页面的样式,就拽一个bootstrap来 需要操作DOM或者发起Ajax请求,就再拽一个Jqu ...
- 【TS】数组和元组
数组 在ts中,定义数组类型语法: let 变量名 : 数据类型[] = [值1,值2,值3] let arr1 : number[] = [1,2,3,4] console.log(arr1); / ...
- C语言-三子棋项目
开源地址 https://kxd.lanzoul.com/iLwHG0e4nupc 肯定有大量BUG 求指出 电脑自动下棋的算法很差 毕竟我也没特意去研究
- 一篇文章让你了解这个基于树莓派而设计的工业计算机-CM4 Industrial
CM4 Industrial是一款基于 Raspberry Pi / 树莓派 Compute Module 4,由EDATEC面向工业应用设计的嵌入式计算机设计的工业嵌入式计算机.系统可以根据不同的应 ...
- mac os黑苹果安装
前言 习惯了mac敲代码的攻城师很难再去适应windows,那么如何在windows上安装苹果系统呢?用黑苹果. 关于黑苹果的安装,网上的一大堆教程显得过于啰嗦,又是安装Unlocker破解mac限制 ...
- shell 命令小记
if [ -d /abc ] if与后面括号要有空格 中括号与内部的变量也要有空格 for header in `ls *.h` do cp $header /usr/include/mymuduo ...
- wwise 音频引擎介绍
https://blog.csdn.net/GJQI12/article/details/108007696
- mybatis动态标签——sql标签
mapper接口 Emp getEmpById(@Param("id") Integer id); mapper.xml <!-- sql片段:可以记录一段sql,在需要用的 ...
- tabs 滑动效果
https://www.zhangxinxu.com/wordpress/2020/07/css-var-improve-components/ 伪类选择器 https://blog.csdn.net ...