Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql connection error in Linux: what about Access denied for user 'root'@'localhost' (using password: YES)

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you the "Linux connection mysql error: Access denied for user 'root'@'localhost' (using password: YES) how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux connection mysql error: Access denied for user' root'@'localhost' (using password: YES) how to do" this article.

Preface

Recently connect mysql/ usr/local/mysql/bin/mysql-uroot-p in linux

An Access denied for user 'root'@'localhost' (using password: YES) error occurred when entering the password. Let's take a look at the detailed solution.

Solution:

1. Stop the mysql service first

Service mysqld stop

two。 Go to the mysql installation directory and bin/ uses safe mode to restart:

. / mysqld_safe-- skip-grant-tables

3. Use the root account, log in without a password, and change the root user password

Mysql-u root use mysqlupdate user set password=PASSWORD ("your password") where User = 'root'

4. Restart mysql and log in normally

Service mysqld restart restart

/ usr/local/mysql/bin/mysql-uroot-p and enter the password you just reset

The above is all the contents of the article "connecting mysql in Linux: what to do with Access denied for user 'root'@'localhost' (using password: YES)". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report