강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của cmxntkxkd2672
cmxntkxkd2672

câu hỏi đã được viết

[Gia hạn] Tạo NodeBird SNS bằng React

Cài đặt MySQL trên Ubuntu

mysql_secure_installation password 질문이요

Viết

·

619

0

... 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.

구글링도하고 mysql다시깔아서 local password도 다시 설정했는데 자꾸 이 오류가 나오네요.. 혹시 해결 방법이 있을까요?

reactreduxnode.jsexpressnext.js

Câu trả lời 2

0

I encountered a frustrating issue when running the mysql_secure_installation command, where I kept getting the following error:

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.

Despite reinstalling MySQL and setting the local password again, the error persisted, leaving me stuck in a loop.

I found a detailed and reliable guide from Vultr that helped me resolve this issue step by step. The guide explained that the root user's authentication method might be set to auth_socket by default on Ubuntu, which causes the issue. To fix this, I followed the steps outlined below:

Steps I Took to Fix the Issue:

  1. Log into MySQL: I logged into MySQL as root with:

    sudo mysql
    
  2. Change the Authentication Method: The default authentication plugin (auth_socket) was the cause of the issue. I ran the following command to change the authentication method to mysql_native_password:

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mynewpassword';
    
  3. Exit MySQL: After that, I exited the MySQL prompt with:

    exit
    
  4. Secure the MySQL Installation: Now, I ran the mysql_secure_installation command again, and this time, it worked without any issues.

The guide from Vultr made it much easier to resolve this problem, especially with the clarification on changing the authentication method and password using the ALTER USER command instead of SET PASSWORD. This simple fix saved me a lot of time and effort, and I highly recommend referring to the Vultr documentation if you're facing similar issues.

For more detailed steps, you can check out the official guide here:
Quick MySQL Installation Guide for Ubuntu 20.04

0

zerocho님의 프로필 이미지
zerocho
Người chia sẻ kiến thức

ALTER USER ... IDENTIFIED WITH MYSQL_NATIVE_PASSWORD by 비번

이것도 하셨는데 안 된다는 말씀이신가요?

일단 저는

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04

이걸로 지난주에 우분투에 설치했습니다.

dsfsdf님의 프로필 이미지
dsfsdf
Người đặt câu hỏi

해결됐습니다! 감사합니다

Hình ảnh hồ sơ của cmxntkxkd2672
cmxntkxkd2672

câu hỏi đã được viết

Đặt câu hỏi