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
基础教程推荐
- 无法解决整理冲突 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
