You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "J.Braeuchi" <jb...@gmx.ch> on 2004/06/24 15:14:09 UTC

[OT] MySql and JDBC under Linux

hi all,

i know the subject is way off topic, but  i'm definitely lost . on my 
windows-machine mysql works perfectly and i can also access it from jdbc
using the url jdbc:mysql://localhost:3306/ojb.

under linux (suse 9.1) i installed mysql and i can used with mysqlcc but 
not with jdbc !?
the only thing i get is a ConnectionException.
i'm sure it must be a small detail but i can't find it :(

jakob

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Thomas Dudziak <to...@first.fhg.de>.
Jakob Braeuchi wrote:

>hi thomas,
>
>it works now when i use the name of the machine. 'localhost' does not work 
>with jdbc, but now i can use mysql to test ojb :)
>  
>

Good news :-)

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi thomas,

it works now when i use the name of the machine. 'localhost' does not work 
with jdbc, but now i can use mysql to test ojb :)

jakob

Am Do Juni 24 2004 20.14 schrieb Thomas Dudziak:
> Jakob Braeuchi wrote:
> > hi thomas,
> >
> > it works now. i had to substitute localhost by 127.0.0.1
> >
> > jdbc:mysql://127.0.0.1:3306/ojb
> >
> > another strange thing is that i cannot use the machines real ip-addr to
> > connect. it has to be 127.0.0.1
>
> This is probably because you did not grant rights to users from other
> ip's. Here's the doc that explains it in more detail:
>
> http://dev.mysql.com/doc/mysql/en/Connection_access.html
>
> However, I have no idea why localhost does not work where 127.0.0.1
> works. Sounds like a little problem with the network setup ? Does
> localhost work in other contexts, e.g. for Apache, Tomcat or similar ?
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Thomas Dudziak <to...@first.fhg.de>.
Jakob Braeuchi wrote:

> hi thomas,
> 
> it works now. i had to substitute localhost by 127.0.0.1
> 
> jdbc:mysql://127.0.0.1:3306/ojb
> 
> another strange thing is that i cannot use the machines real ip-addr to 
> connect. it has to be 127.0.0.1

This is probably because you did not grant rights to users from other 
ip's. Here's the doc that explains it in more detail:

http://dev.mysql.com/doc/mysql/en/Connection_access.html

However, I have no idea why localhost does not work where 127.0.0.1 
works. Sounds like a little problem with the network setup ? Does 
localhost work in other contexts, e.g. for Apache, Tomcat or similar ?

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi thomas,

it works now. i had to substitute localhost by 127.0.0.1

jdbc:mysql://127.0.0.1:3306/ojb

another strange thing is that i cannot use the machines real ip-addr to 
connect. it has to be 127.0.0.1

jakob

Am Do Juni 24 2004 16.08 schrieb Thomas Dudziak:
> Jakob Braeuchi wrote:
> >hi thomas,
> >
> >i'm a linux rookie so i simply installed it with default settings. wht
> > puzzles me is that mysqlcc works but jdbc does not.
>
> mysqlcc probably uses Unix Pipes rather than TCP/IP. When used from a
> different machine to connect to your MySQL, it shouldn't work anymore.
> Since you probably used the MySQL package supplied by SUSE, there is the
> possibility that TCP/IP was disabled per default. Check the
> configuration of mysql, should be somewhere in /etc, or the init.d
> script. Also, the rpm tool of SUSE should be able to show you a list of
> installed files for the MySQL package, and where they were installed.
> On my Mandrake 10, I had the same issue with PostgreSQL, though the
> error message was a bit more helpful: it actually told me to check
> whether TCP/IP connections were enabled.
> You might also want to check out the Connector/J doc:
>
> http://dev.mysql.com/doc/connector/j/en/index.html
>
> I'm no MySQL expert myself. I guess I was lucky so far for MySQL simply
> worked (Windows and Linux).
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Thomas Dudziak <to...@first.fhg.de>.
Jakob Braeuchi wrote:

>hi thomas,
>
>i'm a linux rookie so i simply installed it with default settings. wht puzzles 
>me is that mysqlcc works but jdbc does not.
>  
>
mysqlcc probably uses Unix Pipes rather than TCP/IP. When used from a 
different machine to connect to your MySQL, it shouldn't work anymore. 
Since you probably used the MySQL package supplied by SUSE, there is the 
possibility that TCP/IP was disabled per default. Check the 
configuration of mysql, should be somewhere in /etc, or the init.d 
script. Also, the rpm tool of SUSE should be able to show you a list of 
installed files for the MySQL package, and where they were installed.
On my Mandrake 10, I had the same issue with PostgreSQL, though the 
error message was a bit more helpful: it actually told me to check 
whether TCP/IP connections were enabled.
You might also want to check out the Connector/J doc:

http://dev.mysql.com/doc/connector/j/en/index.html

I'm no MySQL expert myself. I guess I was lucky so far for MySQL simply 
worked (Windows and Linux).

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi thomas,

i'm a linux rookie so i simply installed it with default settings. wht puzzles 
me is that mysqlcc works but jdbc does not.

jakob

Am Do Juni 24 2004 15.26 schrieb Thomas Dudziak:
> J.Braeuchi wrote:
> > hi all,
> >
> > i know the subject is way off topic, but  i'm definitely lost . on my
> > windows-machine mysql works perfectly and i can also access it from jdbc
> > using the url jdbc:mysql://localhost:3306/ojb.
> >
> > under linux (suse 9.1) i installed mysql and i can used with mysqlcc
> > but not with jdbc !?
> > the only thing i get is a ConnectionException.
> > i'm sure it must be a small detail but i can't find it :(
>
> Do you have TCP/IP connections enabled in the MySQL conf ? Check here:
>
> http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html
>
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Thomas Dudziak <to...@first.fhg.de>.
J.Braeuchi wrote:

> hi all,
>
> i know the subject is way off topic, but  i'm definitely lost . on my 
> windows-machine mysql works perfectly and i can also access it from jdbc
> using the url jdbc:mysql://localhost:3306/ojb.
>
> under linux (suse 9.1) i installed mysql and i can used with mysqlcc 
> but not with jdbc !?
> the only thing i get is a ConnectionException.
> i'm sure it must be a small detail but i can't find it :(

Do you have TCP/IP connections enabled in the MySQL conf ? Check here:

http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by WHIRLYCOTT <ph...@whirlycott.com>.
I sent you another email offlist suggesting that you need to enable 
MySQL to listen on port 3306, because it's probably just open over a 
socket by default.

phil.

Jakob Braeuchi wrote:

> hi phil,
> 
> i know this site, but i can't find a solution to my problem there :(
> 
> jakob
> 
> Am Do Juni 24 2004 15.22 schrieb WHIRLYCOTT:
> 
>>You are lost indeed!  Try looking here for information about the MySQL
>>JDBC driver:
>>
>>	http://dev.mysql.com/doc/
>>
>>There are mailing lists there which are better suited to answer your
>>question.
>>
>>phil.
>>
>>J.Braeuchi wrote:
>>
>>>hi all,
>>>
>>>i know the subject is way off topic, but  i'm definitely lost . on my
>>>windows-machine mysql works perfectly and i can also access it from jdbc
>>>using the url jdbc:mysql://localhost:3306/ojb.
>>>
>>>under linux (suse 9.1) i installed mysql and i can used with mysqlcc but
>>>not with jdbc !?
>>>the only thing i get is a ConnectionException.
>>>i'm sure it must be a small detail but i can't find it :(
>>>
>>>jakob
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 

-- 
                                   Whirlycott
                                   Philip Jacob
                                   phil@whirlycott.com
                                   http://www.whirlycott.com/phil/

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi phil,

i know this site, but i can't find a solution to my problem there :(

jakob

Am Do Juni 24 2004 15.22 schrieb WHIRLYCOTT:
> You are lost indeed!  Try looking here for information about the MySQL
> JDBC driver:
>
> 	http://dev.mysql.com/doc/
>
> There are mailing lists there which are better suited to answer your
> question.
>
> phil.
>
> J.Braeuchi wrote:
> > hi all,
> >
> > i know the subject is way off topic, but  i'm definitely lost . on my
> > windows-machine mysql works perfectly and i can also access it from jdbc
> > using the url jdbc:mysql://localhost:3306/ojb.
> >
> > under linux (suse 9.1) i installed mysql and i can used with mysqlcc but
> > not with jdbc !?
> > the only thing i get is a ConnectionException.
> > i'm sure it must be a small detail but i can't find it :(
> >
> > jakob
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [OT] MySql and JDBC under Linux

Posted by WHIRLYCOTT <ph...@whirlycott.com>.
You are lost indeed!  Try looking here for information about the MySQL 
JDBC driver:

	http://dev.mysql.com/doc/

There are mailing lists there which are better suited to answer your 
question.

phil.


J.Braeuchi wrote:

> hi all,
> 
> i know the subject is way off topic, but  i'm definitely lost . on my 
> windows-machine mysql works perfectly and i can also access it from jdbc
> using the url jdbc:mysql://localhost:3306/ojb.
> 
> under linux (suse 9.1) i installed mysql and i can used with mysqlcc but 
> not with jdbc !?
> the only thing i get is a ConnectionException.
> i'm sure it must be a small detail but i can't find it :(
> 
> jakob
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 

-- 
                                   Whirlycott
                                   Philip Jacob
                                   phil@whirlycott.com
                                   http://www.whirlycott.com/phil/

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


RE: [OT] MySql and JDBC under Linux

Posted by Daniel Perry <d....@netcase.co.uk>.
It have it working fine (now), but i have encountered 'issues'.

The main problem i had was that although you use "localhost" in the jdbc
connection url, mysql doesnt think it is localhost.

So if you try to use a user that is restricted to localhost it doesnt work.

Instead you have to use the fully qualified machine name in the Host column
in mysql/user table.

Another problem with OJB is the OJB tables are in all upper case.  In
windows you create them in uppercase but mysql converts them to lower case.
This works fine in windows (as it doesn't care about capitalisation).  If
you dump the database and import it in linux it dies :) so you have to
rename them (or use the origional script).

Daniel.

> -----Original Message-----
> From: J.Braeuchi [mailto:jbraeuchi@gmx.ch]
> Sent: 24 June 2004 14:14
> To: OJB Developers List; OJB Users List
> Subject: [OT] MySql and JDBC under Linux
>
>
> hi all,
>
> i know the subject is way off topic, but  i'm definitely lost . on my
> windows-machine mysql works perfectly and i can also access it from jdbc
> using the url jdbc:mysql://localhost:3306/ojb.
>
> under linux (suse 9.1) i installed mysql and i can used with mysqlcc but
> not with jdbc !?
> the only thing i get is a ConnectionException.
> i'm sure it must be a small detail but i can't find it :(
>
> jakob
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org