SA-MP Forums Archive
Can't connect to MySQL server on VPS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Can't connect to MySQL server on VPS (/showthread.php?tid=632597)



Can't connect to MySQL server on VPS - ax1 - 16.04.2017

Код:
[DEBUG] mysql_connect - host: "my vps IP", user: "root", database: "base", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[DEBUG] CMySQLHandle::Create - creating new connection..
[DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[DEBUG] CMySQLHandle::Create - connection created (id: 1)
[DEBUG] CMySQLConnection::Connect - establishing connection to database...
[ERROR] CMySQLConnection::Connect - (error #2003) Can't connect to MySQL server on 'my vps IP' (111)
I get this error when I try launch my server on hosted virtual private server

Код:
#define    MYSQL_HOST        "my vps IP"
#define    MYSQL_USER        "root"
#define    MYSQL_DATABASE    "base"
#define    MYSQL_PASSWORD    "password"

 mysql_log(LOG_ALL);
 mysql = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
what could cause this to happen?


Re: Can't connect to MySQL server on VPS - Astralis - 17.04.2017

enable external connections HOST % ANY HOST under root user.