By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,203 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,203 IT Pros & Developers. It's quick & easy.

PHP Mysql-API using IPv6

P: n/a
Hi,

I'm trying to connect to a mysql-Server using PHP's mysql-function
mysql_connect. The host on which the mysql-server is running is not the
same as the host apache and php are running on. The two computers are
connected in an IPv6-network.
No matter if I give the hostname (defined in /etc/hosts), the
IPv6-address ("fec0::4") or the IPv6-address in square brackets
("[fec0::4]") the function mysql_connect always prints "Unknown
MYSQL-Server [servername]". Is it because of IPv6? Is PHP's mysql-API
not capable of connecting via an IPv6-network? Unfortunately I didn't
find anything about it in the documentation.
I'm using PHP version 4.3.4. In case this version cannot handle
IPv6-addresses, does anybody know whether PHP 5 beta can?

Thank you for your help!

Torsten
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Torsten Schmidt <gi********@yahoo.co.uk> wrote:
I'm trying to connect to a mysql-Server using PHP's mysql-function
mysql_connect. The host on which the mysql-server is running is not the
same as the host apache and php are running on. The two computers are
connected in an IPv6-network.
Since when does mysql support ipv6?
Is it because of IPv6? Is PHP's mysql-API
not capable of connecting via an IPv6-network?


Have you tried mysql's client instead of the buildin (which is really
old code IIRC)?

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
Daniel Tryba wrote:
Torsten Schmidt <gi********@yahoo.co.uk> wrote:
I'm trying to connect to a mysql-Server using PHP's mysql-function
mysql_connect. The host on which the mysql-server is running is not the
same as the host apache and php are running on. The two computers are
connected in an IPv6-network.
Since when does mysql support ipv6?
Have you tried mysql's client instead of the buildin (which is really
old code IIRC)?


Yes I did. It doesn't work with mysql's client but I thought it's
because the client is too old (I tried the mysql-client from the current
debian-stable release which is version 3.23 and really old).

But I don't know if MySQL Server does support IPv6. Does the server need
to explicitly support it, too? That's a good point... If that's the
reason for not working, is there another open source DB out there that
does support IPv6?

Torsten
Jul 17 '05 #3

P: n/a
Good question. I would think so, since the data structures passed to socket
functions are different from those of IPv4.

Uzytkownik "Torsten Schmidt" <gi********@yahoo.co.uk> napisal w wiadomosci
news:bv************@uni-berlin.de...
But I don't know if MySQL Server does support IPv6. Does the server need
to explicitly support it, too? That's a good point... If that's the
reason for not working, is there another open source DB out there that
does support IPv6?

Torsten

Jul 17 '05 #4

P: n/a
There must be some way though, to route an IPv4 address to an IPv6 address.
You might want to try the TCP/IP newsgroup.

Uzytkownik "Torsten Schmidt" <gi********@yahoo.co.uk> napisal w wiadomosci
news:bv************@uni-berlin.de...
Yes I did. It doesn't work with mysql's client but I thought it's
because the client is too old (I tried the mysql-client from the current
debian-stable release which is version 3.23 and really old).

But I don't know if MySQL Server does support IPv6. Does the server need
to explicitly support it, too? That's a good point... If that's the
reason for not working, is there another open source DB out there that
does support IPv6?

Torsten

Jul 17 '05 #5

P: n/a
Hello,
Yes I did. It doesn't work with mysql's client but I thought it's
because the client is too old (I tried the mysql-client from the current
debian-stable release which is version 3.23 and really old).

But I don't know if MySQL Server does support IPv6. Does the server need
to explicitly support it, too? That's a good point... If that's the
reason for not working, is there another open source DB out there that
does support IPv6?


If you are using Unix/Linux and the Web server is in the same machine as
the MySQL server, you should not be using TCP/IP at all. Instead you
should use only Unix domain sockets. These are twice as fast as TCP
sockets and obviously more secure as nobody can access your database
from outside your server. In that case you should also start MySQL with
the skip-networking option in your /etc/my.cnf file.
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

MetaL - XML based meta-programming language
http://www.meta-language.net/
Jul 17 '05 #6

P: n/a
There is actually, it is possible to tunnel IPv6 traffic via IPv4. But
that wouldn't be of any use for my application.

But Daniel was right - it's not PHP, it's mysql that doesn't support
IPv6. I switched to PostgreSQL now and access that DB from PHP's
postgresql-API works via IPv6! Thank you!

Torsten
Jul 17 '05 #7

P: n/a
I mean the other way around, tunnel IPv4 traffic across an IPv6 network.

Uzytkownik "Torsten Schmidt" <gi********@yahoo.co.uk> napisal w wiadomosci
news:bv************@uni-berlin.de...
There is actually, it is possible to tunnel IPv6 traffic via IPv4. But
that wouldn't be of any use for my application.

But Daniel was right - it's not PHP, it's mysql that doesn't support
IPv6. I switched to PostgreSQL now and access that DB from PHP's
postgresql-API works via IPv6! Thank you!

Torsten

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.