8种机械键盘轴体对比
本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?
安装依赖1yum -y install libicu libxslt-devel
准备RPM包1
2
3
4postgresql10-10.4-1PGDG.rhel7.x86_64.rpm
postgresql10-contrib-10.4-1PGDG.rhel7.x86_64.rpm
postgresql10-libs-10.4-1PGDG.rhel7.x86_64.rpm
postgresql10-server-10.4-1PGDG.rhel7.x86_64.rpm
安装1rpm -ivh *.rpm
初始化数据库
默认数据目录: /var/lib/pgsql/10/data/1/usr/pgsql-10/bin/postgresql-10-setup initdb
自定义目录1
2
3
4
5mkdir -p /opt/PostgreSQL/data
chmod 755 -R /opt/PostgreSQL/data
chown postgres:postgres -R /opt/PostgreSQL
su postgres
/usr/pgsql-10/bin/initdb --encoding=UTF-8 --local=zh_CN.UTF8 --username=postgres --pwprompt --pgdata=/opt/PostgreSQL/data
修改service环境变量
修改Environment:PGDATA的数据目录为/opt/PostgreSQL/data1
2vim /usr/lib/systemd/system/postgresql-10.service
systemctl daemon-reload
修改postgres用户的环境变量PGDATA1
2su postgres
vi ~/.bash_profile
启动1
2
3
4
5
6# 启动
systemctl start postgresql-10.service
# 开机启动
systemctl enable postgresql-10.service
# 关闭开机启动
systemctl disable postgresql-10.service
登录1
2su postgres
psql -U postgres
查看当前数据目录1
2
3
4show data_directory;
----------------------
/opt/PostgreSQL/data
(1 row)
修改密码1
2postgres=# password
ALTER USER postgres WITH PASSWORD 'xxxxx';
数据库登录权限设置
$PGDATA/pg_hba.conf 权限相关配置1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
#host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 md5
# IPv6 local connections:
#host all all ::1/128 trust
host all all ::0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication all trust
#host replication all 127.0.0.1/32 trust
#host replication all ::1/128 trust
host replication repl slave trust
设置trust,本地可以使用psql -U postgres直接登录服务器
设置peer,本地可以使用psql -h 127.0.0.1 -d postgres -U postgres直接登录服务器
设置password,使用用户名密码登录
$PGDATA/postgresql.conf 数据库相关配置1
2listen_addresses = '*'
posrt = 5432
设置监听任意IP, 允许任意ip连接数据库
更多权限说明,见官方文档