Mombu the GNU Linux Forum sponsored links

Go Back   Mombu the GNU Linux Forum > GNU_Linux > mysql DB connection setup
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 15th January 15:38
charly
External User
 
Posts: 1
Default mysql DB connection setup



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 !
  Reply With Quote


  sponsored links


2 16th January 17:40
charly
External User
 
Posts: 1
Default mysql DB connection setup



Everything was ok excepted that I had forgotten to remove the password
of the user I was trying with

Sorrrrryyyyyy
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666