diff --git a/golang_learn/data_office/get_hy_sql/main.go b/golang_learn/data_office/get_hy_sql/main.go index 1eb5b2f..129489a 100644 --- a/golang_learn/data_office/get_hy_sql/main.go +++ b/golang_learn/data_office/get_hy_sql/main.go @@ -22,7 +22,7 @@ import ( //存在所有对象信息 - 集合 func main() { - sqlPath := "D:/hy_qggwy_kk.sql" + sqlPath := "./hy_qggwy_kk.sql" db, _ := sql.Open("mysql", "root:admin@tcp(127.0.0.1:35017)/hy_qggwy?charset=utf8") log.Print("操作数据库连接:", db) @@ -128,7 +128,7 @@ func runSQL(mysqlPath, sqlPath string) { log.Print("调用执行对应的SQL脚本:", sqlPath) c := exec.Command("cmd", "/C", mysqlPath+"mysql -uroot -padmin hy_qggwy < "+sqlPath) if err := c.Run(); err != nil { - log.Fatal("执行时发生异常!异常为:", err) + log.Print("【不影响执行】执行时发生异常!异常为:", err) } log.Print("预置脚本数据成功!") }