MySQL and java connectivity
Hi All I've managed to install the java mysql driver and it seems to be working correctly. The problem is that the java applet I have written, when it tries to connect, depending upon whether localhost was used or the hostname was used, the connection will either be established or not. Working the problem through I think it is something to do with tcpd wrappers, as mentioned in /usr/shared/packages/mysql/readme.suse (I think!). In desparation I have added the following line to my hosts.allow file ALL : ALL However still no joy. It would have been nice in the documentation if there was an example of how to enable remote clients to connect to mysqld through the tcpd wrappers. Running SuSE 8.1 and the user table in the mysql database has been set up to accept connections from other hosts. Regards Bill
Bill Antonia <bill@beaconhillcott.freeserve.co.uk> wrote:
I've managed to install the java mysql driver and it seems to be working
The one just for MySQL, or an ODBC one?
correctly. The problem is that the java applet I have written, when it tries to connect, depending upon whether localhost was used or the hostname was
With ODBC, I've hit problems in the connector trying to use a domain socket instead of a TCP socket if "localhost" is given, but domain sockets weren't enabled on that system. I don't know if that's similar to your problem. -- MJR http://mjr.towers.org.uk/ IM: slef@jabber.at This is my home web site. This for Jabber Messaging. How's my writing? Let me know via any of my contact details.
I doubt this is whats causing your problem but it's possible. On Redhat 8.0 the version of mysql on it has (or had - i'm not sure if its been fixed yet) a problem in that you can ONLY access it from localhost. Trying to access it from any other ip than 127.0.0.1 didn't work and it wasn't just a badly configured firewall or anything silly like that - it was an acknowledged bug. I don't suppose that could be affecting you could it? Alex Brett alex.brett@brettcomputers.co.uk On 15 May 2003 at 0:52, Bill Antonia wrote:
Hi All
I've managed to install the java mysql driver and it seems to be working correctly. The problem is that the java applet I have written, when it tries to connect, depending upon whether localhost was used or the hostname was used, the connection will either be established or not. Working the problem through I think it is something to do with tcpd wrappers, as mentioned in /usr/shared/packages/mysql/readme.suse (I think!). In desparation I have added the following line to my hosts.allow file ALL : ALL However still no joy. It would have been nice in the documentation if there was an example of how to enable remote clients to connect to mysqld through the tcpd wrappers.
Running SuSE 8.1 and the user table in the mysql database has been set up to accept connections from other hosts.
Regards Bill
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
Hi Sorry I forgot to say the driver is the one from http://www.mysql.com Connect/J jdbc driver Regards Bill
Hi All I've done a kludge which has worked but involves the use of rinetd. By listening on one port and redirecting to port 3306 on the same machine, I can make mysqld think the connection is from the local machine! Haha. Yes it means security is up the spout and more ports are assigned than are required. However if nobody has any other ideas I may have to follow through with this. It is on an internal server with low grade data so security is not a major issue. Many thanks Bill
--- Bill Antonia <bill@beaconhillcott.freeserve.co.uk> wrote:
Hi All
[..snip..]
through I think it is something to do with tcpd wrappers, as mentioned in /usr/shared/packages/mysql/readme.suse (I think!). In desparation I have added the following line to my hosts.allow file ALL : ALL However still no joy. It would have been nice in the documentation if
Errrr, you do realise the potential security risk that you are taking by doing that??? My suggestion would be if you added the following to "/etc/nsswitch.conf": Locate the line that looks like: "hosts: dns files" and add the word "all" after "file".
there was an example of how to enable remote clients to connect to mysqld through the tcpd wrappers.
tcpd wrappers are only there as a means of security purposes, they do not hinder their operation in anyway. Before you connect, run: lsof to see what pipes you have open, and check that you're listening on the right port. Kind Regards, -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com __________________________________________________ Yahoo! Plus For a better Internet experience http://www.yahoo.co.uk/btoffer
Hi Yes I know putting ALL : ALL in my hosts.allow file is very risky, this was done in desparation. Once I've got it working I will reduce the access. One thing I did try last night was to put the full host.network name in the user table of the mysql database rather than just the host worked (hooray) whereas it didn't before. I can now connect into the database from the local machine not using localhost as the hostname but rather the full host.network name. At this stage I have tried to copy this process to our server at school and it works except remote machines still have problems connecting. I have had no chance to test remote connections on system at home as it was getting very late. As for the Red Hat problem, does anyone know if the version supplied with SuSE 8.1 have similar problems? Regards Bill
--- Bill Antonia <at@beacon.e-sussex.sch.uk> wrote:
Hi
Yes I know putting ALL : ALL in my hosts.allow file is very risky, this was done in desparation. Once I've got it working I will reduce the access.
LOL, good :)
One thing I did try last night was to put the full host.network name in the user table of the mysql database rather than just the host worked (hooray) whereas it didn't before. I can now connect into the database from the local machine not using localhost as the hostname but rather the full host.network
We call this "host.network" a FQDN (Fully Qualified Domain Name)
name. At this stage I have tried to copy this process to our server at school and it works except remote machines still have problems connecting. I have had no chance to test remote connections on system at home as it was getting very late.
As for the Red Hat problem, does anyone know if the version supplied with SuSE 8.1 have similar problems?
As long as you maintain your settings, you'll have no problems :) -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com __________________________________________________ Yahoo! Plus For a better Internet experience http://www.yahoo.co.uk/btoffer
participants (5)
-
Alex Brett
-
Bill Antonia
-
Bill Antonia
-
MJ Ray
-
Thomas Adam