Unable to connect to SQL Server 2005

I am trying to setup a new OpenFire server which uses an external database. While connecting, I get this error with every type of login that I use. I even used the sa account and am unable to get connected. This leaves me stuck on the install wizzard at the database creation point.

2008.11.21 07:49:40 [org.jivesoftware.util.log.util.CommonsLogFactory$1.error(CommonsLogFactory.jav a:92)] Prototype
java.sql.SQLException: Cannot open database “[OpenFire]” requested by the login. The login failed.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:602)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:344)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.logicalcobwebs.proxool.DefaultConnectionBuilder.buildConnection(DefaultConn ectionBuilder.java:39)
at org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java:159)
at org.logicalcobwebs.proxool.Prototyper.sweep(Prototyper.java:102)
at org.logicalcobwebs.proxool.PrototyperThread.run(PrototyperThread.java:44)



Did you create the dabase container OpenFire on your MSSQL 2005 server first? Openfire connects to an existing database and creates the tables it does not create the database.

Morning Todd,

Yes, I created an empty database, tried to connect and got the error I posted. I then deleted the database, created a new database, and ran the SQL script so it would create the tables and such. Same error.


Todd this is what is repeating in the SQL Log

11/21/2008 14:19:09,Logon,Unknown,Login failed for user ‘admin’. [CLIENT:]
11/21/2008 14:19:09,Logon,Unknown,Error: 18456 Severity: 14 State: 16.
11/21/2008 14:18:43,Logon,Unknown,Login failed for user ‘admin’. [CLIENT:]
11/21/2008 14:18:43,Logon,Unknown,Error: 18456 Severity: 14 State: 16.
11/21/2008 14:18:12,Logon,Unknown,Login failed for user ‘admin’. [CLIENT:]
11/21/2008 14:18:12,Logon,Unknown,Error: 18456 Severity: 14 State: 16.
11/21/2008 14:17:41,Logon,Unknown,Login failed for user ‘admin’. [CLIENT:]
11/21/2008 14:17:41,Logon,Unknown,Error: 18456 Severity: 14 State: 16.

This sounds like a database permissions issue. After you create the db container for openfire you need to assign proper user permissions to the database. Use you SQL management software that came with the server to check that you have created a valid user account and assigned it all rights to the openfire db container you created.

The account has the same permissions as the ‘sa’ account does. It is set as dbowner schema, and role. If I connect to the database with SQL Management Studio using the account I created, I can manage all aspects of the server.

I am having exactly the same issue.

SQL Server 2005. External connections allowed over both named pipes and TCIP.

Database openfire created. User openfire created with SQL Server authentication openfire as default database and database mapping to openfire database with DBO rights.

Successufully connected via Apex SQL to create the database tables as stated in installation guide using credentials copied from notepad to ensure no typos.

Attempted to connect via the setup process using same credentials and errored as above. Database log shows:

Error: 18456, Severity: 14, State: 16.
LOGIN failed FOR user ‘openfire’. [CLIENT: xx.x.x.xxx]

All research points to this user not having the rights to connect to the database but I have proved this is not the case by using another client (ApexSQL) to connect successfully using SQL native.

Could this be an issue with the ANSI defaults for the database when used with a jdbc setting? I have had issues with PHP but usually only on SP execution.

If so what should the correct ANSI Defaults be for connection to a database via jdbc?


DOH! I was thinking in SQL terms where you do actually use [] around object names in case they are reserved words or contain characters it does not like.

All I had to do was remove the square brackets from my DB name. Server worked with or without for some reason.