Commit 77825bd6 by 孙龙

up

parent 3ca364bd
Showing with 2 additions and 1 deletions
package mysql
import (
"fmt"
"github.com/go-xorm/xorm"
_ "github.com/go-sql-driver/mysql"
"search_server/pkg/config"
......@@ -23,7 +24,7 @@ func _setup() error{
host := db.Host
database := db.Database
dataSourceName := userName + ":" + password + "@tcp(" + host + ")/" + database + "?charset=utf8"
dataSourceName := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",userName,password,host,database)
DatabaseConMap[conName], err = xorm.NewEngine("mysql", dataSourceName)
if err!=nil{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment