parent
e374a8a3e1
commit
bb36010ca0
|
|
@ -13,9 +13,9 @@ type IpInformation struct {
|
|||
TimeZone string `json:"Time_Zone"`
|
||||
}
|
||||
|
||||
func MysqlQuery(ip string) IpInformation {
|
||||
func MysqlQuery(ip string, dsn string) IpInformation {
|
||||
// 连接到MySQL数据库
|
||||
db, err := sql.Open("mysql", "root:990821@tcp(192.168.2.20:3306)/checkip")
|
||||
db, err := sql.Open("mysql", dsn)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue