So I set up MySQL on my LAMP VPS, and I have Pocketmine installed on Cent OS 7 x64, and when I try to connect to MySQL on a plugin I get this error: I also get this error when using more common plugins like pureperms and such. When loading/ reloading the server, it will say enabling plugin, then get stuck for a while, then load that error then load the server as normal with the plugin disabled.
If you are trying to access MySql on a different server to PocketMine you'll need to check that remote MySql connections are allowed (connecting as root is disabled by default, but you shouldn't be using root anyway), that the remote user connecting has the correct database privileges, and that the firewall on the MySql server has been configured to accept connections, usually on port 3306.
You could try making your connection persistent by adding p: before your host. (Eg. p:127.0.0.1) http://php.net/manual/en/function.mysql-pconnect.php