go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.19k stars 3.88k forks source link

Gorm cann't connect Doris #7102

Open Cookiery opened 2 weeks ago

Cookiery commented 2 weeks ago

GORM Playground Link

https://github.com/go-gorm/playground/pull/1

Description

Gorm cann't not connect Doris

Gorm version:

gorm.io/driver/mysql v1.5.7 gorm.io/gorm v1.25.10 gorm.io/plugin/dbresolver v1.5.0

example code:

Settings.Doris.DSN = fmt.Sprintf(`%v:%v@tcp(%v)/%v?charset=utf8mb4&parseTime=True&loc=Local`,
        Settings.Doris.UserName, Settings.Doris.Password, Settings.Doris.Host, Settings.Doris.DBName)

var DorisDB *gorm.DB
log.Infof("Init doris connection...")
DorisDB, err = gorm.Open(mysql.Open(config.Settings.Doris.DSN), &gorm.Config{Logger: newLogger})
if err != nil {
    return fmt.Errorf("connect doris fail: %s", err.Error())
}

error: error connect doris fail: invalid connection

github-actions[bot] commented 2 weeks ago

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking