You are not logged in.

#26 2008-03-24 22:26:39

Kobussie
Member
From: NL - Groningen
Registered: 2007-04-06
Posts: 43
Website

Re: [SOLVED] php-mysql connection

Hello again everyone!

I just read something in the LAMP-Wiki (http://wiki.archlinux.org/index.php/LAMP) that may be important:

*  You can get the "error no. 2013: Lost Connection to mysql server during query" message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the hosts_access(5) system to allow or disallow connections.

    * If you're running into this problem, be sure to add this to your /etc/hosts.allow file:

# mysqld : ALL : ALLOW
# mysqld-max : ALL : ALLOW
# and similar for the other MySQL daemons.

    * Notes: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of ALL. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.

So I'm going to take a look at man 5 hosts_acces now. Here's my

- /etc/hosts.allow:

sshd: 10.0.0.0/255.255.255.0
mysqld: 10.0.0.0/255.255.255.0

- /etc/hosts.deny:

ALL:  ALL:  DENY

Any suggestions?

Offline

#27 2008-03-24 23:33:21

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: [SOLVED] php-mysql connection

Hello!

My hosts file:

shaika-dzari:$ > cat hosts.allow
#
# /etc/hosts.allow
#
#mysqld: ALL: ALLOW
# Let everyone connect
sshd: ALL
# End of file
shaika-dzari:$ > cat hosts.deny
#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file

Try without the mysqld: 10.0.0.0/255.255.255.0.

@+

Offline

#28 2008-03-25 12:37:57

Kobussie
Member
From: NL - Groningen
Registered: 2007-04-06
Posts: 43
Website

Re: [SOLVED] php-mysql connection

Hi Shaika-Dzari,

I read again all the posts from yesterday. What exactly do you mean by:

Shaika-Dzari wrote:

Do you skip arch configure script?

I'll try the "/etc/hosts.allow" suggestion later today.

Last edited by Kobussie (2008-03-25 12:39:01)

Offline

#29 2008-03-25 13:06:48

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: [SOLVED] php-mysql connection

I have **never** had to do anything with hosts.allow in order to get PHP/MySQL to work.
I strongly doubt that's the answer... unless we are talking of some obscure and particular setup.

R.

Offline

#30 2008-03-25 13:15:47

Kobussie
Member
From: NL - Groningen
Registered: 2007-04-06
Posts: 43
Website

Re: [SOLVED] php-mysql connection

Or maybe the firewall?? I'll try again later by switching it off.

Switching of the firewall didn't do anything, it wasn't working at all!! (as a result of previous experiments wink );

BUT: (especially to ralvez) I think hosts.allow WAS the problem!!

I added this line:

ALL:  localhost, 127.0.0.1

to /etc/hosts.allow. Now I get this returned:

Connected
Could not perform the specified querry
All done

As result of the "ralvez" script !!!

In other words: PROBLEM SOLVED.

Thanks to everyone for your kind cooperation!!!

Ko

Last edited by Kobussie (2008-03-25 17:05:21)

Offline

#31 2008-03-26 02:49:31

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: [SOLVED] php-mysql connection

Glad you got your set up working... but I wonder ... again, you should not have to enable hosts.allow to use  PHP/MySQL
Do you have set up /etc/hosts with the name of your machine and the loopback? Like:
127.0.0.1       localhost.localdomain         localhost yourmachinename

If you do not **that** could be the real reason.

Again, not important if you are happy with your set up just that I find the "solution" to be odd. roll

R.

Offline

#32 2008-03-26 13:14:03

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: [SOLVED] php-mysql connection

FWIW:  I had to put something in my HOSTS.ALLOW:

mysqld : ALL : ALLOW

It wouldn't work until I did this.


Matt

"It is very difficult to educate the educated."

Offline

Board footer

Powered by FluxBB