按照项目github文档上所示,在使用 mysql 时你可能会这样写:

$ migrate -path db/migrations -database mysql://root:123456@127.0.0.1:3306/mydb version

 

-database 用于指定数据库 DSN 格式的连接,每个驱动所支持的会不一样,使用 mysql 参考如下格式:

mysql://user:password@tcp(host:port)/dbname?query

 

所以用法是 migrate -source "file://migration/scripts" -database "mysql://root@tcp(localhost:3306)/texo_ewallet_db" up

https://github.com/golang-migrate/migrate/issues/178

 

golang-migrate/migrate 快速使用指南 

Proj:https://github.com/farwish/orderCentreServe

Link:https://www.cnblogs.com/farwish/p/14220602.html

相关文章:

  • 2022-01-22
  • 2022-02-09
  • 2021-12-02
  • 2021-09-10
  • 2021-12-18
猜你喜欢
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案