更新时间:2023-02-04 07:46:19
连接远程数据库需要三件事:
There a three things you need to connect to a remote database:
几乎所有托管公司都关闭了防火墙上的 3306 端口,并且不允许直接远程访问.即使他们这样做,您也不会获得连接到数据库的权限.
Virtual all hosting companies close port 3306 on the firewall, and do not allow direct remote access. And even if they do, you won't get privileges to connect to a database.
仅当远程数据库在您的 LAN 中,或者您正在使用具有 root 访问权限的 VPS 时,您才能进行配置以建立远程连接.
Only if the remote database is in your LAN, or you are using a VPS with root access you can configure things to make a remote connection.