还要开启MySQL远程访问授权
启动mysql
systemctl start mariadb.service 或者 systemctl start mysqld.service
结束
systemctl stop mariadb.service 或者 systemctl stop mysqld.service
重启
systemctl restart mariadb.service 或者 systemctl restart mysqld.service
5、设置远程登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
6、刷新权限
FLUSH PRIVILEGES ;
另外,如果是云服务器有安全规则,要开启3306端口访问授权
还要开启MySQL远程访问授权
另外,如果是云服务器有安全规则,要开启3306端口访问授权