Unable to connect to MariaDB using DBeaver(无法使用 DBeaver 连接到 MariaDB)
问题描述
我刚刚在 Ubuntu 18.04 上安装了 MariaDB 10.1.29.从命令行我可以使用 sudo 进行连接:
I just installed MariaDB 10.1.29 on Ubuntu 18.04. From the command line I can connect using sudo:
sudo mysql -u root -p
但不是没有 sudo.
But not without sudo.
另外,如果我尝试通过 DBeaver 连接到数据库,我会得到:
Also, if I try to connect to the database through DBeaver, I get:
Could not connect: Access denied for user 'root'@'localhost'
虽然凭据正确.我尝试安装 MySQL 5.7,但我也遇到了完全相同的问题.
While the credentials are correct. I tried installing MySQL 5.7, but I'm experiencing the exact same issue there as well.
我错过了什么?
推荐答案
事实证明,这是 MariaDB 和 MySQL 的预期行为.为了克服这个问题,建议创建一个单独的用户并授予对创建的所有数据库的访问权限.以下是有关如何使用命令行创建数据库并向您选择的用户授予权限的分步指南.
As it turns out, this is expected behaviour for MariaDB and MySQL. To overcome the issue, it is advisable to create a separate user and grant access to all databases created. Here is a step by step guide on how to create databases using the command line and grant permissions to the user of your choice.
$ sudo mysql -u root -p
创建数据库
mysql> CREATE DATABASE `database_name`;
创建用户
mysql> CREATE USER 'user_name' IDENTIFIED BY 'a_secure_password';
授予用户权限
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'%' WITH GRANT OPTION;
应用更改
mysql> FLUSH PRIVILEGES;
这篇关于无法使用 DBeaver 连接到 MariaDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法使用 DBeaver 连接到 MariaDB


- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01