OpenVZ Forum


Home » General » Support » Connection to mysql-VE failed.
Connection to mysql-VE failed. [message #25411] Sun, 23 December 2007 23:22 Go to next message
Kutschka is currently offline  Kutschka
Messages: 24
Registered: February 2007
Junior Member
Hello,

I try to connect to VE-Mysql from VE.

(The VE-MySql is not reachable from outside/internet.)

VE: 192.168.1.1
VE-MySql : 192.168.1.2

I become the error:
"Error: 2003 (Can't connect to MySQL server on '192.168.1.2' (111))"

And for debug in the VE-MySql:
# tcpdump -i venet0 dst port 3306

in the VE:
# telnet 192.168.1.2 3306

=>Trying 192.168.1.2...
telnet: Unable to connect to remote host: Connection refused

I read the thread
http://forum.openvz.org/index.php?t=msg&goto=8628&
Quote:


...check iptables on the HN and the VE....



But what shoud I do with iptables? Do I need to route the port, even the mysqlVE is only internal reachable?

Thank you,
Kutschka

Re: Connection to mysql-VE failed. [message #25414 is a reply to message #25411] Mon, 24 December 2007 00:15 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
Kutschka wrote on Sun, 23 December 2007 18:22

Hello,

I try to connect to VE-Mysql from VE.

(The VE-MySql is not reachable from outside/internet.)

VE: 192.168.1.1
VE-MySql : 192.168.1.2

I become the error:
"Error: 2003 (Can't connect to MySQL server on '192.168.1.2' (111))"

And for debug in the VE-MySql:
# tcpdump -i venet0 dst port 3306

in the VE:
# telnet 192.168.1.2 3306

=>Trying 192.168.1.2...
telnet: Unable to connect to remote host: Connection refused

I read the thread
http://forum.openvz.org/index.php?t=msg&goto=8628&
Quote:


...check iptables on the HN and the VE....



But what shoud I do with iptables? Do I need to route the port, even the mysqlVE is only internal reachable?

Thank you,
Kutschka




The iptables rules should be nothing.

Can you ping the host from inside?

Can you, from the mysql-ve, ping anything outside? Are you sure you set the IP address correctly?

Are you sure that mysql is started in the mysql-ve?


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page

[Updated on: Mon, 24 December 2007 00:15]

Report message to a moderator

Re: Connection to mysql-VE failed. [message #25420 is a reply to message #25414] Mon, 24 December 2007 09:51 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

mysqld is running and listen not only to 127.0.0.1 (=localhost!) ?

Re: Connection to mysql-VE failed. [message #25423 is a reply to message #25420] Mon, 24 December 2007 11:37 Go to previous messageGo to next message
Kutschka is currently offline  Kutschka
Messages: 24
Registered: February 2007
Junior Member
Hello,

Can you ping the host from inside?
=> Yes.

Can you, from the mysql-ve, ping anything outside? Are you sure you set the IP address correctly?
=> Yes I can ping from each other..

Are you sure that mysql is started in the mysql-ve?
=> Yes its running..

Any idea?

[Updated on: Mon, 24 December 2007 11:48]

Report message to a moderator

Re: Connection to mysql-VE failed. [message #25424 is a reply to message #25420] Mon, 24 December 2007 12:33 Go to previous messageGo to next message
Kutschka is currently offline  Kutschka
Messages: 24
Registered: February 2007
Junior Member
curx wrote on Mon, 24 December 2007 04:51

Hi,

mysqld is running and listen not only to 127.0.0.1 (=localhost!) ?





Hello,

I did comment out the line in the my.cnf
## bind-address=127.0.0.1

But now I become the error:
[email]root@server6[/email]:/# telnet 192.168.1.2 3306
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.
DHost '192.168.1.1' is not allowed to connect to this MySQL serverConnection closed by foreign host.

[Updated on: Mon, 24 December 2007 12:33]

Report message to a moderator

Re: Connection to mysql-VE failed. [message #25428 is a reply to message #25424] Mon, 24 December 2007 14:52 Go to previous message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
This is MySQL saying that you are not allowed to connect. You must add a user in MySQL. If you don't know how, please read the MySQL manual or post in a MySQL-related forum or mailing list.

Regards,
Ugo


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Previous Topic: Is it possible to use 'insmod command' for device driver loading inside VE ?
Next Topic: *SOLVED* lfd problem ConfigServer Security & Firewall (csf)
Goto Forum:
  


Current Time: Sun Aug 11 14:53:12 GMT 2024

Total time taken to generate the page: 0.02957 seconds