This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
2,087 Views 14 Replies Last post: Jul 8, 2008 4:41 PM by g money RSS
vectorz Bronze 6 posts since
Jul 2, 2008
Currently Being Moderated

Jul 2, 2008 11:49 AM

Strange MySQL problem - localhost connection

 

I have openfire (latest rpm from website) already working on server 'john' which is a FC4 with mysqld 5.0.51a but it was a test environment.  I've decided to move it to a production env, so I'm trying to re-install openfire on a particular linux server named 'james' with mysqld 5.0.51a.  I did the same exact steps as before, however, when running the web setup for the first time, when it gets to database setup and I enter the appropriate mysql settings, it just hangs.  I've done some extensive testing, and here is what I've found:

 

  1. I'm sure i disabled iptables (for troubleshooting)

  2. On james, if I point to localhost database, it hangs - however, if i point to the database on john it goes through without problem.

  3. On john, if i re-run the setup and point to db on james, it also works without problem.  This leads me to believe the db on james is fine.

  4. On james, I can connect via mysql client to localhost using both -S (socket) as well as network (-h) and works fine using the openfire username and password to connect to db.  This is further indication that mysql connectivity works fine to localhost, and further isolates openfire as specifically the problem.

  5. When I do a tcpdump, I see that the web admin hangs when trying to "SHOW.SESSION.VARIABLES" from local mysql.

  6. I've double checked that the grants for 'openfire'@'%' as well 'as'openfire'@'localhost' both have same password and have ALL privileges to openfire.*.

I'm not sure what else I can do to figure out the problem, it's driving me crazy!  Any help would be much appreciated.

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Jul 2, 2008 1:44 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

Hi,

 

are you already connected and authenticated? The query should not block, or it should produce a timeout.

 

Are there any errors in the MySQL log files?

 

LG

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Jul 3, 2008 12:04 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

Hi,

 

it could help to add openfire@hostname as another user, I usually do this when using MySQL.

 

LG

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Jul 3, 2008 12:50 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

Hi,

 

you could try to replace openfire/lib/mysql.jar with another version, maybe with http://www.igniterealtime.org/fisheye/browse/~raw,r=3978/svn-org/wildfire/trunk/ build/lib/dist/mysql.jar (see http://www.igniterealtime.org/fisheye/browse/svn-org/openfire/trunk/build/lib/di st/mysql.jar) which is quite old.

 

Or try to download the current version from the MySQL web site.

 

LG

g money Bronze 5 posts since
Jul 7, 2008
Currently Being Moderated
Jul 8, 2008 12:43 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

 

I'm running into the samething.

 

 

I can connect fine to a remote MYSQL dbase but not to one on localhost

 

 

I can access the localhost dbase fine using commandline.

 

 

 

 

 

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Jul 8, 2008 1:09 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

Hi,

 

could you try to run "netstat -an | grep 3306" to display the IP addresses MySQL is listening. Maybe you did specify 192.168.22.33:3306 in my.cnf so trying to connect to 127.0.0.1:3306 will not work.

 

LG

g money Bronze 5 posts since
Jul 7, 2008
Currently Being Moderated
Jul 8, 2008 2:15 PM in response to: LG
Re: Strange MySQL problem - localhost connection

 

That's a good suggestion this is what I've got.

 

 

my.cnf DOES have my ip address and not 127.0.0.1

 

 

tcp        0      0 205.226.5.28:3306       0.0.0.0:*           &nbs p;   LISTEN  

 

 

 

 

 

As you were aluding to ... 127.0.0.1 does not work

 

 

  1. mysql -p -h 127.0.0.1 -D openfire

Enter password:

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

 

 

 

But I can do this.

 

 

  1. mysql -p -h localhost -D openfire

Enter password:

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 271

Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql> show tables;

----


Tables_in_openfire

----


jiveExtComponentConf

 

| jiveGroup            |

<snip>

 

 

 

 

 

 

 

 

Let me go mess with MYSQL config a bit and I'll get back to you.

 

 

Thanks for the suggestion.

 

 

 

 

 

g money Bronze 5 posts since
Jul 7, 2008
Currently Being Moderated
Jul 8, 2008 3:43 PM in response to: g money
Re: Strange MySQL problem - localhost connection

 

That was the trick.

 

 

I commented out bind-address in my.cnf and restarted mysql

 

 

  netstat -an | grep 3306

tcp        0      0 0.0.0.0:3306            0.0.0.0:*           &nbs p;   LISTEN

 

 

 

 

 

Thanks for the great and fast response.

 

 

 

 

 

 

 

 

 

 

 

g$

 

 

g money Bronze 5 posts since
Jul 7, 2008
Currently Being Moderated
Jul 8, 2008 4:08 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

 

what happens when you do something like the following?

 

 

mysql -p -h 127.0.0.1 -D openfire

 

 

g money Bronze 5 posts since
Jul 7, 2008
Currently Being Moderated
Jul 8, 2008 4:41 PM in response to: vectorz
Re: Strange MySQL problem - localhost connection

 

yup ... as you already know ... working like it should.

 

 

Sorry. I've got nothing.

 

 

g$

 

 

 

 

 

More Like This

  • Retrieving data ...

Bookmarked By (0)