Skip to content

Use Environment.UserName as the default user name #1161

Open
@bgrainger

Description

@bgrainger

This SO user (https://stackoverflow.com/questions/71742985/how-to-compose-a-connection-string-without-login-credentials-net-mysqlconnector) expects MySqlConnectionStringBuilder.UserID to default to the current Unix user when connecting via a Unix socket. That is how some other MySQL client libraries behave:

https://dev.mysql.com/doc/refman/8.0/en/user-names.html

On Unix, most MySQL clients by default try to log in using the current Unix user name as the MySQL user name, but that is for convenience only.

https://dev.mysql.com/doc/c-api/8.0/en/mysql-real-connect.html

The user argument contains the user's MySQL login ID. If user is NULL or the empty string "", the current user is assumed. Under Unix, this is the current login name.

The workaround is to manually set MySqlConnectionStringBuilder.UserID to Environment.UserName or a hard-coded user name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions