Skip to content

Cannot set password for mysql, thus cannot connect to mysql service using username and password. #1694

Open
@Winson-Huang

Description

Documentation Issue

https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-database#install-mysql
https://github.com/MicrosoftDocs/WSL/blob/main/WSL/tutorials/wsl-database.md#install-mysql

my distro is Ubuntu, when I run the security script prompts using command sudo mysql_secure_installation , and set password according to the prompt, it print some error info:

... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

So, I cannot set password for root and any other users of mysql, thus I cannot connect to mysql service using username and password. At present, it seems that the only way to get a mysql command prompt is sudo mysql command in WSL shell.

However, most database client need username and password when config a new connection, that means the mysql service in WSL basically cannot be used in development and programming.

Link to documentation page

https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-database#install-mysql
https://github.com/MicrosoftDocs/WSL/blob/main/WSL/tutorials/wsl-database.md#install-mysql

Suggested Improvements

WSL document should list a correct way to set password for MySQL.

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