Home > System Tutorial > LINUX > body text

Solve the problems encountered by Idea in Ubuntu 18.04 when operating the database

PHPz
Release: 2023-12-27 20:35:12
forward
748 people have browsed it

Like the title, record the steps to solve a failure: The idea failed to operate the database in linux (ubuntu 18.04), and the error message was: Client does not support authentication protocol requested by server; consider upgrading MySQL client. Because I am also a novice, there are some concepts in it It is based on my understanding. If there are any mistakes, please correct me!!!

Possible reasons: Insufficient permissions

I found that when I enter mysql in the terminal, I need root permission every time. Otherwise, "Access denied for user 'root'@'localhost'" will be the same even in navicat. Ordinary users cannot connect at all. It reports a 2002 error. But if I am the root user, there is no problem logging in. It’s very confusing!
So I suspect it is because my idea does not have root permissions. After all, I opened the idea with ordinary user permissions.
Attached is the terminal login mysql method (root can be replaced with other user names)

via :~$ mysql -u root -p
Copy after login

Approximate solution: Create a new ordinary user. This user has all permissions to add, delete, modify and check. Use this username and password to log in in idea. It works!! Detailed operation Use root permissions to enter mysql

via :~$ sudo su
via :~$ mysql -u root -p
Copy after login

increase user

CREATE USER '用户名'@'host' IDENTIFIED BY '密码';
Copy after login

Authorization (I grant all permissions, so it is ALL, please modify it depending on the situation)

GRANT ALL ON *.* TO '用户名'@'localhost';
Copy after login

refresh

flush privileges;
Copy after login

The above is the detailed content of Solve the problems encountered by Idea in Ubuntu 18.04 when operating the database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template