DBeaver连接MariaDB数据库问题

本文档涵盖了三个关于MariaDB的问题及其解决方案:1) 防火墙阻止telnet连接,通过在防火墙中添加开放端口解决;2) 授权问题导致的'Access denied for user'root'@'gateway'',通过grant all privileges命令授权;3) 字符集问题引起的数据插入错误,通过修改配置文件并重启服务来设置正确的字符集。

1、防火墙问题:

说明:使用telnet命令连接不通mariadb服务器端口

解决方案:

为防火墙添加开放端口命令:firewall-cmd --zone=public --add-port=3306/tcp --permanent

重新载入命令:firewall-cmd --reload

然后问题解决。

2、Could not connect to address=(host=192.168.90.3)(port=3306)(type=master) : (conn=4) Access denied for user 'root'@'gateway' (using password: YES)
Current charset is GBK. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
  (conn=4) Access denied for user 'root'@'gateway' (using password: YES)
Current charset is GBK. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
  (conn=4) Access denied for user 'root'@'gateway' (using password: YES)
Current charset is GBK. If password has been set using other charset, consider using option 'passwordCharacterEncoding'

问题说明:这是对root用户的授权问题。

解决方案:grant all privileges on *.* to 'root'@'%' identified by 'root';

3、 SQL 错误 [1366] [22007]: (conn=5) Incorrect string value: '\xE5\x9B\x9B' for column 'area_cut' at row 1

问题说明:字符集问题

解决方案:修改字符集

step1:使用 whereis my.ini 查询配置文件路径

step2:添加配置信息

default-character-set=utf8
character-set-server=utf8

step3:重启服务

systemctl restart mariadb.service

如果还未解决,尝试重新建库,设置默认字符集

create database db_name default character set utf8; 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值