There is a problem connecting to the database, some error or exception related to database connection is displayed.
CAUSES AND RESOLUTIONS
As the problem-statement is quite general, there can be many causes to that and each cause it’s own resolution. Here we try to list the most common causes and their resolutions.
The database server does not allow SQL Server and Windows authentication.
To check this, go to your SQL server, login, and right click on the server's name (in left menu). A pop up opens. Now click on the Security tab in left menu and check the SQL Server and Windows Authentication mode (don't forget to click OK also).
The DB instance name is not correct in the configuration files
Check it in init_sample_exe.config (Change all (localhost) to .\SQLEXPRESS or whatever the db instance name is)
Also do it in web.config files ->
(the root names can be different, depending on your configuration)
There are 2 leading backslhashes in web.config fiels before the server name
Be sure that there are not 2 leading backslashes before the servers name in web.config files
The users in the web.config do not match the users of the database
Be sure that user in web.config and users of the database, e.g. AxCMS_Sample are the same and passwords are the same.
E.g. in web.config file UID=AxinomCMS, then database user, who must have connection permission, must be also AxinomCMS, and if in web.config is PWD=AxinomCMS1, the user made to the Login of SQL server and added to Users of AxCMS_Sample, should also have password inserted as AxinomCMS (for login making and users adding please visit help and support center http://en.help.axcms.net/Getting_Started.AxCMS?ActiveID=6340#DB )
The login user does not have sufficient rights
The login user should have db_reader and db_writer roles.
Also be sure that login database user (e.g. AxinomCMS) has permission to connect to database and login is enabled (SQL server -> Security -> right click on the user -> select Properties -> Status)
TCP/IP protocol is not enabled for the SQL Server and/or the wrong port is used.
TCP/IP protocol must be enabled for the SQL server and port 1433 must be used
- Check if you can connect to the SQL Server port 1433 by using telnet. In order to do that, open CMD (Start->run; type "cmd") and type: telnet localhost 1433 at the PC the SQL Server is installed
- If your check failed, then please check your firewall settings of the PC where the SQL Server is installed (look below to the point of enabling remote connection).
- Check if your SQL Server is configured to accept TCP/IP connections:
- open Start->Programs->Microsoft SQL Server 2005->Configuration Tools->SQL Server Configuration Manager ->SQL Server Network Utility and add TCP/IP to the "enabled protocols" list. If its already in the list, but it is disabled, enable it.
- additionally to look over after the TCP/IP is enabled : make a double click TCP/IP and switch to tab "IPAddresses". Then please check if TCP Dynamic Ports is blank and TCP Port is set to 1433.
- restart your SQL Server (by stopping and starting it explicitly)
For more information please visit http://www.datamasker.com/SSE2005_SCM1.htm .
SQL Server is on another machine, but it does not allow remote connections
By default, SQL Server 2005 Express Edition and SQL Server 2005 Developer Edition do not allow remote connections.
Use the following steps to enable remote access to SQL Express:
- Programs, Microsoft SQL Server 2005, Configuration Tools, SQL Server Configuration Manager.
- In the left pane of the SQL Server Configuration Manger, expand the node for SQL Server 2005 Network Configuration and select Protocols for SQLEXPRESS.
- In the right pane, right-click Named Pipes and choose Enable (for more information http://www.datamasker.com/SSE2005_NetworkCfg.htm ).
- Right-click TCP/IP and choose Enable.
- In the left pane, select SQL Server 2005 Services.
- In the right pane, right-click SQL Server Browser and choose Properties.
- Click the Services tab in the Properties dialog box.
- On the Services page, set the Start Mode property to Automatic and click OK.
- Right-click SQL Server Browser and choose Start.
- Right click SQL Server (SQLEXPRESS) and choose Restart.
Use the following steps to configure the Windows firewall.
- Open the Windows Firewall dialog box and click the
- Click Add Program and Browse to find sqlbrowser.exe and click OK.
- Click Add Program and Browse to find sqlservr.exe. Click OK.
- Click Add Port and enter "SQL Service" for Name, 1433 for Port number, and select the TCP radio button.
- Click OK on the Windows Firewall dialog
and some advanced tips to search more
- Enable the TCP/IP protocol using the Surface Area Configuration Utility [Link http://www.datamasker.com/SSE2005_SAC.htm]
- Make sure the SQL Server browser is started. Note this step is optional. It is possible to set the SQL Server instance to use a fixed IP address - but this is non-standard for named instances. See sqlexpress's WebLog http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx for details. [Link http://www.datamasker.com/SSE2005_SCM2.htm ]
- Make sure SQL Server and SQL Server Browser are exempted by the firewall on the server machine. This is done by putting sqlservr.exe and sqlbrowser.exe as an exception in the windows firewall.
Note: In order to get things to work. You might need to completely reboot the server machine after making the changes. There have been reports (thanks P.C.) that starting and stopping the SQL Server and Browser software is not enough.
Even more information here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
Our customers and partners keep asking us, which version of SQL Server 2005 is the most convenient one. Use the following tables to determine which features are supported by the various editions of Microsoft SQL Server 2005.
AxCMS.net versions: All versions