Closed liuyangsds closed 4 years ago
Any update on this. I am also getting the same issue. I am using gorm version 1.9.12
@liuyangsds your table name should be users
@liuyangsds Defining a struct pays attention to the case of the syntax type User struct { Id int UserddName string Mobile string Password string Nickname string }
@liuyangsds Defining a struct pays attention to the case of the syntax type User struct { Id int UserddName string Mobile string Password string Nickname string }
Thank you for the reminder
why reopened? any problem?
package main
import ( "fmt" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" )
type User struct { id int userddname string mobile string password string nickname string }
func main() { db,err := gorm.Open("mysql","root:liuyang@(localhost:3306)/goodgame?charset=utf8mb4&parseTime=True&loc=Local") if err != nil { fmt.Println(err) } defer db.Close()
}