Greetings,
I'm trying to connect to my mysql database with Java and fails
It may be related to :
my firewall rules
/etc/hosts
mysql config
So here are the tests I have done so far :
my firewall accepts all output and input on localhost :
protec="/sbin/iptables"
$protec -A INPUT -i lo -j ACCEPT
$protec -A OUTPUT -o lo -j ACCEPT
So should be ok
my mysql config :
/etc/my.cnf
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
I can connect from a PHP application
I can connect from mysqlcc
My Java code is ok (comes from a tutorial) and I get the following msg
: Server configuration denies access to data source
I used Postgres and discovered that I had to allow connection on socket
and TCP-IP but found nothing regarding this on mysql
I then did some Google and found this :
<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
My user's table in mysql has a root user on localhost
If as root, I try # domainname
NONE
Finally, I have a DNS running
Any ideas ? I'm lost and not guru regarding networking setup
thank you for tips or tutorials !