原因:没有引入mysql存储引擎 解决:import引入mysql存储引擎 import ( _ "github.com/go-sql-driver/mysql" "github.com/jinzhu/gorm" )