版权声明:TC太子 https://blog.csdn.net/sinat_37812248/article/details/80524022
链接数据库时,新建的用户(或者是注册时的用户)没有远程访问的权限.
在navicat-用户-编辑用户-主机从localhost中改为%
命令行:1:mysql -uroot -p
2grant all privileges on *.* to 'root'@'%' identified by 'sunliya' with grant option;
flush privileges;
OK了!