Problem with SQL

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
9/3/2009 12:27:38 PM
Gravatar
Total Posts 22

Problem with SQL

Hy all,

I've put my new mojo web site on the remote web server and now I get this erro message:

System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at mojoPortal.Data.DBPortal.DatabaseHelperGetConnectionError(String overrideConnectionInfo)

Please help,

Bobo

9/3/2009 12:31:59 PM
Gravatar
Total Posts 2239

Re: Problem with SQL

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

Please verify that your sql connection in the user.config is configured properly.

-Joe D

9/3/2009 12:51:25 PM
Gravatar
Total Posts 22

Re: Problem with SQL

Still doesn't work.

My settings in user.config are the same as before and when I'm running site on localhost there is no problem, but when I try to open domain I get this message.

I needed to change security of site into medium trust and I did that according to instructions and I add the string

<add key="RunningInMediumTrust" value="true" />

into user.config. I've changed strings in web.config and web.fulltrust.config with the strings from user.config and still no go. Here are the strings from web.config:

<add key="MSSQLConnectionString" value="Data Source=.\SQLExpress;Database=hsps...

<add key="CacheMSSQLParameters" value="true" />

<add key="MSSQLOwnerPrefix" value="[dbo]." />

<add key="PostgreSQLConnectionString" value="Server=localhost;Port=5432;Encoding=unicode;User Id=mojouser;Password=mojo123;Database=mojoportal;Pooling=false;CommandTimeout=120;" />

<add key="MySqlConnectionString" value="Server=localhost;Database=mojoprod;Uid=root;Pwd=" />

<add key="PostgreSQLConnectionString" value="Server=localhost;Port=5432;User Id=postgres;Password=;Database=mojo;Pooling=false;Encoding=UNICODE;" />

<add key="FirebirdConnectionString" value="Data Source=localhost;Server Type=0;Port Number=3050;Database=C:\mojoportal\mojoportal.fdb;Dialect=3;Charset=UTF8;Pooling=True;Min Pool Size=0;Max Pool Size=200;Connection Timeout=10;Connection Lifetime=60;Fetch Size=200;User Id=SYSDBA;Password=masterkey" />

HELP! :(

9/3/2009 12:56:00 PM
Gravatar
Total Posts 18439

Re: Problem with SQL

Its not possible to use a local database for a site hosted on the internet. You need a database at your host.

9/3/2009 1:28:57 PM
Gravatar
Total Posts 22

Re: Problem with SQL

I think I've got it this time.

How can I force mojo to connect to MySql and not to MSSQL (I don't have free MSSQL right now on hosting server but only MySQL)?

9/3/2009 1:34:32 PM
Gravatar
Total Posts 2239

Re: Problem with SQL

Take a look at the Installing with MySQL documentation.

After setting your user.config mysql connection info, and copying the necessary files, you will have to go to http://YOURSITE.URL/Setup/Default.aspx so that the database can be populated with the table structure and such. If you already have data in your MSSQL, I'm not sure you're going to be able to switch to MySQL.

HTH,
Joe

9/3/2009 2:10:06 PM
Gravatar
Total Posts 18439

Re: Problem with SQL

The bad news is if you are in cheap hosting or really most shared hosting environments, you are probably hosted in Medium Trust and if that is the case it may only work if the host has the same version of MySql connector that we depend on installed in the GAC or has customized their trust policy to allow data access without the driver being installed in the GAC.

It may work or it may not depending on your host. If not the symptom will be a security exception.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.