运用Navicat插件连接腾讯云CentOS7服务器中的mysql数据库

1,先关闭CentOS服务器中的防火墙(连接前提)

查看防火墙状态

firewall-cmd --state

运用Navicat插件连接腾讯云CentOS7服务器中的mysql数据库

如上图所示:防火墙是关闭的,如果你的防火墙是开启的,则

systemctl stop firewalld.service  就可以关闭防火墙

 

2.Navicat插件远程连接(下图所示)

运用Navicat插件连接腾讯云CentOS7服务器中的mysql数据库

连接名可以忽略

主机名:你的云服务器外网ip地址

端口号:mysql数据库的默认端口号为3306

用户名:云服务器中的mysql默认的数据库连接用户root

密码:云服务器中的mysql默认的数据库连接用户root的密码

这样你本机的Navicat就可以远程连接云服务器中的mysql数据库了



3.问题

当你在Navicat中执行某条sql语句时,会提示以下报错

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

相应解决方法:

在my.cnf 里面设置sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'