MySQL Connection via second VPS

Hello,

i have little question about connecting mysql via second VPS. I have 2 VPS - Server & MySQL/phpmyadmin and i want to connect 2 different vps servers to one, but i dont know how.

This connection string didnt work correctly, it needs localhost or something.

Thanks.

you can enter the ip of the second vps on the place where it says “localhost”

I did that, but still there’s so much mysql errors and TIMEDOUT stuff.

Open 3306 or whatever port you’re using for MySQL on that VPS, also make sure to allow remote connections.

There’s one error code what i’ve get.

SCRIPT ERROR in promise (unhandled): Error: ER_HOST_NOT_PRIVILEGED: Host 'li1401-166.members.linode.com' is not allowed to connect to this MariaDB server

You need give permission to that VPS, because the ip or whatever is block the connection to your MySQL server.

My english not is very good, I hope you can understand me

Create a new user with all permissions or whatever you want, and make sure to allow remote connections