• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

MySQL Connection problem

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


i which to install jforum with a mysql 4.0.21 DB, but during installation i ever get a connection error. I have tested other users and users without password but allways the same error.
something that doesn't shows correct is that in the error allways user root with password = yes but i don,t use the user root (i Have tested with them too).

when trying hsqldb everything works.

have anyone any idea whats the problem?

Thanks

mfg Gideon


[originally posted on jforum.net by Gideon]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hhmmm.. Which JForum version? 2.0 or 2.0.1?

As I check this issue, you can try configuring JForum manually.. Is not complex. Just follow the steps as described at http://www.jforum.net/install_no_wizard.htm

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Rafael Steil wrote:Hhmmm.. Which JForum version? 2.0 or 2.0.1?



I use the 2.0.1 Version.

Thanks.

mfg Gideon.
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem. In fact, it's depend on how you are supposed to access the database.

My internet host provider gave me 2 URLs:

mysql:jdbc://servername:port/account

and

mysql:jdbc://servernameDNS/account

I had the problem with the second, and not with the first one.

I think it's because my web site already used the first URL and JForum provide a connection pool.

So, check if you don't have concurrent access to database. Check also if you are using the last driver for both (web site and jforum).
[originally posted on jforum.net by Blackwings]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I released a new version of JForum, which fixes some issues with the installer. Please download at http://www.jforum.net/download.htm.

Thanks.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think the problem is that the properties file is not update when a user set values for the username and the password.
Hence, database.connection.string is not updated to and then jforum use always root as username and password.
To fixe the bug, these lines has to be add in:

**********************************************************

p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/" + type + "/" + type + ".properties"));

//update the file proprieties
p.put(ConfigKeys.DATABASE_CONNECTION_HOST, host);
p.put(ConfigKeys.DATABASE_CONNECTION_USERNAME, username);
p.put(ConfigKeys.DATABASE_CONNECTION_PASSWORD, password);
p.put(ConfigKeys.DATABASE_CONNECTION_DBNAME, dbName);
p.put(ConfigKeys.DATABASE_CONNECTION_ENCODING, encoding);
p.store(new java.io.FileOutputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/" + type + "/" + type + ".properties"), "MySql settings");
p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/database/" + type + "/" + type + ".properties"));


**********************************************************

class: InstallationAction.java
method: configureDatabase()
location: before the loop for() and after p.load(...)
(In the source code I have, it's the line 549 but I made some modifications...)

Normally, it's working
Best greats
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem is that installation (mysql) writes to wrong config-file. Fix file and problem is away.
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gideon wrote:Hi,


i which to install jforum with a mysql 4.0.21 DB, but during installation i ever get a connection error. I have tested other users and users without password but allways the same error.
something that doesn't shows correct is that in the error allways user root with password = yes but i don,t use the user root (i Have tested with them too).

when trying hsqldb everything works.

have anyone any idea whats the problem?

Thanks

mfg Gideon


[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gideon wrote:Hi,


i which to install jforum with a mysql 4.0.21 DB, but during installation i ever get a connection error. I have tested other users and users without password but allways the same error.
something that doesn't shows correct is that in the error allways user root with password = yes but i don,t use the user root (i Have tested with them too).

when trying hsqldb everything works.

have anyone any idea whats the problem?

Thanks

mfg Gideon


[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When add user add acces by it's host
See mysql manual about users management.
(grant ... no ... to 'username'@'hostname')
or just change mysql.users table so as you need and make flush privileges.
[originally posted on jforum.net by Ilya1st]
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic