Golang on Ubuntu: this user requires mysql native password authentication.

I found a problem when i will run golang project, this is my message error


2023/02/16 09:43:29 Service RUN on DEBUG mode
2023/02/16 09:43:29 this user requires mysql native password authentication.
exit status 1

Solution:

1. Change the password setting of the user to connect to the database, like this


- mysql -u root -p
- ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[password]'
- ALTER USER 'root'@'localhost' IDENTIFIED BY '#d4esUqzQpS9XZNv';

2. Go to /etc/mysql/my.cnf and add this config



[mysqld]
default-authentication-plugin=mysql_native_password

it's work for me


2023/02/16 10:01:33 Service RUN on DEBUG mode

   ____    __
  / __/___/ /  ___
 / _// __/ _ \/ _ \
/___/\__/_//_/\___/ v3.3.5
High performance, minimalist Go web framework
https://echo.labstack.com

0 komentar:

Posting Komentar