Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

Cannot connect remote database mysql from hosting

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Locked
  • Print view
Advanced search
6 posts • Page 1 of 1
madip
Posts: 8
Joined: Fri Feb 06, 2015 7:19 am

Cannot connect remote database mysql from hosting

Post by madip » Fri Feb 13, 2015 6:47 pm

Hi,
the problem is always the same.
I cannot connect hosting php web site on my mysql vesta vps.
From command line i can connect without any problem and from many location.
Mysql log error doesn't trace any error.
I set bind address to my external ip but nothing.
I stopped iptables and fail2ban.
The strange behavior is the for some minute i see website working but then ,after a while, always same message:
Can't connect to MySQL server on 'ip address'

On the other vps (without vesta) i can connect without any problem......(same OS , same mysql version, apache,php etc)
Please give me a solution
thanks
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cannot connect remote database mysql from hosting

Post by skurudo » Sat Feb 14, 2015 5:31 pm

Oh, it's Vesta fault again? ;)

There is simple solution:
[*] firewall of the server must be set-up to enable incomming connections on port 3306
[*] you must have a user in MySQL who is allowed to connect from % (any host) (see manualfor details)

More detailed thread - http://stackoverflow.com/questions/1935 ... -using-php
Top

madip
Posts: 8
Joined: Fri Feb 06, 2015 7:19 am

Re: Cannot connect remote database mysql from hosting

Post by madip » Sun Feb 15, 2015 9:50 am

[*] firewall of the server must be set-up to enable incomming connections on port 3306
firewall is set correctly
[*] you must have a user in MySQL who is allowed to connect from % (any host) (see manualfor details)
already done.

For a while connection was up. Then after some minutes was down again!
Client error is : SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'ip' (4)
the error code (4) means interrupted system call.
From the remote command line I can make connection and querying wihout problem.
Very strange problem!
Moreover with tcdump i see incoming / outgoing connection:

Code: Select all

10:52:38.688313 IP remoteserver.53428 >localvps.mysql: Flags [S], seq 2938696093, win 14600, options [mss 1460,sackOK,TS val 1253572476 ecr 0,nop,wscale 7], length 0
10:52:38.688363 IP localvps.mysql > remoteserver.53428: Flags [S.], seq 2585169861, ack 2938696094, win 14480, options [mss 1460,sackOK,TS val 21884416 ecr 1253572476,nop,wscale 7], length 0
In outogoing conn ack value is very high!!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cannot connect remote database mysql from hosting

Post by skurudo » Sun Feb 15, 2015 4:52 pm

Then problem may be in php.ini

max_execution_time
mysql.connect_timeout

And php limitations.
Top

madip
Posts: 8
Joined: Fri Feb 06, 2015 7:19 am

[SOLVED ]Re: Cannot connect remote database mysql from hosti

Post by madip » Tue Feb 17, 2015 7:20 pm

Hosting doesn't allow connection to external database.
So it's not vesta problem. Hosting limitation.
thanks
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cannot connect remote database mysql from hosting

Post by skurudo » Tue Feb 17, 2015 7:22 pm

Expected unexpected ;-)
Thanks for answer.
Top


Locked
  • Print view

6 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password