[SOLVED] Cannot connect to DB SQL Server 2008 Express

Moderator: crythias

Locked
andreaska
Znuny newbie
Posts: 4
Joined: 26 Jun 2012, 13:56
Znuny Version: 3.1.6
Real Name: Andrea

[SOLVED] Cannot connect to DB SQL Server 2008 Express

Post by andreaska »

Hi!
I've a problem with connection from OTRS (install in a Windows Server 2008 R2) and SQL Server 2008 Express.
I followed the guide http://wiki.otterhub.org/index.php?titl ... _and_IIS_7, but the script CheckDB.pl returns the error:

Code: Select all

C:\OTRS>perl bin\otrs.CheckDB.pl
DBI connect('driver={SQL Server};Server=localhost,1433;database=otrs','otrs',...) failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Accesso non riuscito per l'utente 'otrs'. (SQL-28000) at C:/OTRS/Kernel/System/DB.pm line 256ERROR: OTRS-otrs.CheckDB.pl-10 Perl: 5.14.2 OS: MSWin32 Time: Tue Jun 26 14:09:5
1 2012
Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Accesso non riuscito per l'utente 'otrs'. (SQL-28000)

 Traceback (1860):
   Module: Kernel::System::DB::new (v1.144.2.1) Line: 227
   Module: bin\otrs.CheckDB.pl (v1.4) Line: 52

Trying to connect to database
DSN: DBI:ODBC:driver={SQL Server};Server=localhost,1433;database=otrsDatabaseUser: otrs

No database connect!
This is the configuration of db connection in Config.pm:

Code: Select all

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #
    # DatabaseHost
    # (The database host.)
    $Self->{DatabaseHost} = 'localhost';
    # Database
    # (The database name.)
    $Self->{Database} = 'otrs';
    # DatabaseUser
    # (The database user.)
    $Self->{DatabaseUser} = 'otrs';
    # DatabasePw
    # (The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords.)
    $Self->{DatabasePw} = 'otrs';
    # DatabaseDSN
    # (The database DSN for MySQL ==> more: "man DBD::mysql")
    #####$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

	
	$Self->{DatabaseDSN} = "DBI:ODBC:driver={SQL Server};Server=$Self->{DatabaseHost},1433;database=$Self->{Database}";
	$Self->{Database::Type} = 'mssql'; 
This is the CheckModule.pl:

Code: Select all

C:\OTRS>perl bin\otrs.CheckModules.pl
   o CGI..............................ok (v3.59)
   o Crypt::PasswdMD5.................ok (v1.3)
   o Crypt::SSLeay....................ok (v0.58)
   o CSS::Minifier....................ok (v0.01)
   o Date::Format.....................ok (v2.24)
   o Date::Pcalc......................ok (v1.2)
   o DBI..............................ok (v1.622)
   o DBD::mysql.......................ok (v4.020)
   o DBD::ODBC........................ok (v1.37)
   o DBD::Oracle......................Not installed! (Optional - Required to connect to a Oracle database.)
   o DBD::Pg..........................ok (v2.18.1)
   o Digest::MD5......................ok (v2.51)
   o Digest::SHA::PurePerl............ok (v5.70)
   o Digest::SHA......................ok (v5.62)
   o Encode::HanExtra.................Not installed! (Optional - Required to handle mails with several Chinese character sets.)
   o Encode::Locale...................ok (v1.02)
   o GD...............................ok (v2.46)
      o GD::Text......................ok (v0.86)
      o GD::Graph.....................ok (v1.44)
      o GD::Graph::lines..............ok (v1.15)
      o GD::Text::Align...............ok (v1.18)
   o IO::Scalar.......................ok (v2.110)
   o IO::Wrap.........................ok (v2.110)
   o JavaScript::Minifier.............ok (v1.05)
   o JSON.............................ok (v2.53)
      o JSON::PP......................ok (v2.27200)
      o JSON::XS......................ok (v2.32)
   o Locale::Codes....................ok (v3.18)
   o LWP::UserAgent...................ok (v6.03)
   o Mail::Internet...................ok (v2.08)
   o Mail::POP3Client.................ok (v2.18 )
      o IO::Socket::SSL...............ok (v1.44)
   o Mail::IMAPClient.................ok (v3.30)
      o IO::Socket::SSL...............ok (v1.44)
   o MIME::Base64.....................ok (v3.13)
   o MIME::Tools......................ok (v5.428)
   o ModPerl::Util....................Not installed! (Optional - Improves Performance on Apache webservers dramatically.)
      o Apache::DBI...................ok (v1.11)
      o Apache2::Reload...............Not installed! (Optional - Should be installed on mod_perl based installations to automatically reload changed Perl files and configuration data.)
I tried all solutions on the forum, but I could not solve the problem.
Can anyone help me?
Thank you!
Andrea
Last edited by andreaska on 26 Jun 2012, 17:01, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Cannot connect to DB SQL Server 2008 Express

Post by crythias »

Accesso non riuscito: Login failed
This is incorrect username/password or database doesn't exist.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
andreaska
Znuny newbie
Posts: 4
Joined: 26 Jun 2012, 13:56
Znuny Version: 3.1.6
Real Name: Andrea

Re: Cannot connect to DB SQL Server 2008 Express

Post by andreaska »

The OTRS user exists and has all permissions set correctly as a guide!
I enclose below the screenshot of the configuration of SQL Server...
Thanks!!!
Immagine.png
Immagine2.png
You do not have the required permissions to view the files attached to this post.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Cannot connect to DB SQL Server 2008 Express

Post by crythias »

I can't really help, then. Login failed means login failed. It's not an OTRS problem as much as it's a connectivity issue via ODBC. See if you can check any other (SQL?) Logs.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
andreaska
Znuny newbie
Posts: 4
Joined: 26 Jun 2012, 13:56
Znuny Version: 3.1.6
Real Name: Andrea

Re: Cannot connect to DB SQL Server 2008 Express

Post by andreaska »

Can you tell me how can I test the ODBC connectivity?
Is there an easy way to do this kind of test?
Thanks for your interest!
andreaska
Znuny newbie
Posts: 4
Joined: 26 Jun 2012, 13:56
Znuny Version: 3.1.6
Real Name: Andrea

[SOLVED] Cannot connect to DB SQL Server 2008 Express

Post by andreaska »

I did it!
I followed your advice, I consulted the LOG of SQL server and I found this error:

Code: Select all

2012-06-26 16:43:53.96 Accesso     Errore: 18456, gravità: 14, stato: 58.
2012-06-26 16:43:53.96 Accesso     Login failed for user 'otrs'. Motivo: tentativo di accesso tramite l'autenticazione di SQL non riuscito. Il server è configurato solo per l'autenticazione di Windows. [CLIENT: 127.0.0.1]
I then changed the authentication type on the instance of sql server from "windows only" to "+ sql windows" and you're done!!
Immagine3.png
Thank you for your support!

See you soon!
You do not have the required permissions to view the files attached to this post.
Locked