远程连接服务器上数据库
之报错问题总结
一、服务器上安全组打开数据库端口(默认端口为3306)

二、授予权限
报错

进入数据库
授权
授权命令:
grant all privileges on *.* to 'root'@'我电脑的ip地址' identified by '密码';
你也可以直接改成这样:
grant all privileges on *.* to 'root'@'%' identified by '123456';
就可以给所有ip都设定root登陆了。
刷新授权
flush privileges;
退出
exit
重启mysql服务
service mysqld restart
成功