Mysql, JDBC on Linux

C

charly

Greetings,

I've installed mysql on my linux Box and the server is up and running.

I then tried to access my server via JDBC and could not while my Java
code is ok (comes from my course :) but we worked under W2K there :) )
and I get the following msg :

Server configuration denies access to data source.

I googled and found some info regarding the hosts file which needed to
be set, it was the commonest error and so on ...

<QUOTE>
If you look at your mysql database user table. It probably has an entry for
localhost and bizservers.com. If you change the bizservers.com to be the
same as /etc/hosts or change the order in /etc/hosts or us the IP address in
the mysql database it will work.
</QUOTE>

So I cat my /etc/hosts :

127.0.0.1 localhost
127.0.0.1 localhost.lan.com localhost
10.0.0.1 me.lan.com me

I setted my hosts file and still no go ; Moreover my user's table in
Mysql has a root user on localhost, my firewall allows traffic on localhost.

I posted on a linux group but got no answer so if anybody here can help
a student revise his exams and practise Java :)

Thx a lot !
 
C

charly

After stopping checking in linux, I went back to the basics and check my
users in MySql admin, and guess what :) the user I was using had a
password :)

Feel dumb somewhat :)
 
G

Gerbrand van Dieijen

After stopping checking in linux, I went back to the basics and check my
users in MySql admin, and guess what :) the user I was using had a
password :)

To make live even more complicated ;-):
http://www.mysql.com/articles/connection_pooling_with_connectorj.html

This describes how you can set up a connection pool in Tomcat with MySQL.

It's not hard to set up, but you'll need access to the server.xml in
/etc/tomat4/...
When you retrieve connections this way, connections are reused. This can
greatly improve perfomance.

Since jdbc-connections may not be thread save, and it's usually best for
perfomance to use a connection for a short while for optimilization
issues, it is not a good idea to put connections in a session variable or
even register it as an application variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top