本文介绍了在 VPS 服务器上安装 MySQL 并从其他服务器连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在全球(美国西部、美国南部、欧洲、中国)几乎没有 VPS 服务器和云服务器,用户被重定向到最近的具有 DNS IP 地理位置的服务器.我的服务器目前提供静态内容,但我正在更改我的应用程序,因此我需要一个数据库,尤其是 MySQL.

I have few VPS servers and few Cloud servers across the globe (West US, South Us, Europe, China) and users are redirected to the nearest server with DNS IP Geolocation. My servers currently serve static content but I am changing my app so I am in need of a database, particularly MySQL.

起初我打算使用 Amazon RDS,但我发现在 VPS 上安装我自己的 MySQL 最终会更便宜(小型实例 72 美元 VS Linode 1024 40 美元)

At first I was going to use Amazon RDS but I found out that installing my own MySQL on a VPS it will end up cheaper ($72 dollars for a small instance VS $40 dollars of a Linode 1024)

所以我在伦敦买了一个 linode VPS,我在我的 VPS 上安装了 MySQL 和 Phpmyadmin,在 Phpmyadmin 中我的用户是 root@localhost 因此我无法从我的其他服务器连接到我的数据库.

So I bought a linode VPS in London and I installed MySQL and Phpmyadmin onto my VPS and within Phpmyadmin my user is root@localhost thus I cannot connect to my database from my other servers.

Server version: 5.0.51a-24+lenny5
Protocol version: 10
Server: Localhost via UNIX socket
User: root@localhost

我在这里错过了什么?我怎样才能让这个 MySQL 数据库被全局访问?

What I'm I missing here? How can I make this MySQL database accessed globaly?

我所有的云/VPS 服务器都是 Debian 5.0.

All my cloud/VPS servers are Debian 5.0.

推荐答案

您想要 启用远程连接.

最具体地说,您必须为需要连接的每个 IP 添加一个对您的数据库具有适当权限的 MySQL 用户.

Most specifically, you'll have to add a MySQL user with the appropriate permissions for your database for each IP that needs to connect.

链接的文章显示了您必须执行的所有步骤.

The linked article shows all the steps you'll have to perform.

这篇关于在 VPS 服务器上安装 MySQL 并从其他服务器连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 07:52
查看更多