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;