_partials/cn/windows_postgresql.md
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做PostgreSQL。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在安装它。
运行下方指令:
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
sudo /etc/init.d/postgresql start
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
你可以把PostgreSQL配置成自动启动,这样每次你打开新的终端时,你就不需要执行sudo /etc/init.d/postgresql start:
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
sudo chmod 440 /etc/sudoers.d/postgresql
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
打开一个新的终端。
:heavy_check_mark: 如果你看到一行字说* Starting postgresql (via systemctl): postgresql.service还是* Starting PostgreSQL 14 database server,那你就可以进行下一步了 :+1:
:x: 如果没有的话, 请让老师来帮助你。