Ubuntu安装aqueduct、 postgresql、Dart(专家请绕道,仅提供给不熟悉的童鞋)

  • Ubuntu一些常用的命令
    • 列出软件的所有版本
      • apt-cache madison <>
    • 下载
      • apt-get install <>=<>
    • 查询端口,杀死进程
      • ss -alnp | grep 8080
      • kill -9 pid
  • Ubuntu安装aqueduct、 postgresql、Dart
    • Dart要安装对应版本的,我安装的是2.8.1-1,可以通过上面的常用命令去查看有哪些版本,选择之后按照下面的格式安装
      • apt-get install dart=2.8.1-1
      • 需要配置一下环境变量,应该是在/root/.profile
    • 安装aqueduct
      • pub global activate aqueduct
      • aqueduct create 你的项目名
      • 测试连接
        • aqueduct serve
      • 项目中配置database.yaml
        • username: "postgres"
        • password: "123456"
        • host: "127.0.0.1"
        • port: 5432
        • databaseName: "testdb"
      • 项目中配置config.yaml
        • port: 80
        • database:
          • host: "127.0.0.1"
          • port: 5432
          • databaseName: "testdb"
          • username: "postgres"
          • password: "123456"
    • 安装postgresql,我安装的是12
      • sudo apt-get -y install postgresql-12
      • su postgres
      • postgres#: createdb testdb
      • 连接
        • aqueduct db generate 会在项目中生成一个文件夹migrations
        • aqueduct db upgrade --connect postgres://postgres:[email protected]:5432/testdb
        • 成功后,aqueduct serve运行
    • 在浏览器中输入127.0.0.1/example

你可能感兴趣的:(Ubuntu安装aqueduct、 postgresql、Dart(专家请绕道,仅提供给不熟悉的童鞋))