Skip to content

Is it possible to set the default value of "allowNativePasswords" to "true"? #642

Closed
@bingosummer

Description

@bingosummer

Issue description

The default value of allowNativePasswords should be true. But it's false by default. Using other language's mysql driver, the connection is established without the option allowNativePasswords, when the mysql server requires native password authentication.
So is it possible to set the default value to true?

Example code

package main

import (
        "database/sql"
        "log"
         _ "github.com/go-sql-driver/mysql"
)

func main() {
        db, err := sql.Open("mysql", "<username>:<password>@tcp(host:port)/database_name")
        if err != nil {
                log.Fatal(err)
        }
        defer db.Close()

        err = db.Ping()
        if err != nil {
                log.Fatal(err)
        }
}

Error log

2017/08/01 08:32:44 this user requires mysql native password authentication.

Configuration

Driver version (or git SHA): 1.3

Go version: go version go1.8 linux/amd64

Server version: MySQL 5.7

Server OS: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions