• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

7.5.6 / SQL Server Express errors...

S

Soulhuntre

Guest
Here is the situation...

  • SQL Server Express is in, and works fromt he Plesk control panel (I can make a DB, user and so on)
  • I can access databases on the traditional manner (make them ahead, set the connections tring)
  • ASP.NET 2.0 is installed and working

The problem is that one of the big advantages of Express / .NET .20 for rapid development and testing is that you can simply use a database that is in your web directory. That it does not need to be "in the server" ahead of time.

However, to "mount" the DB ont he fly, SQL Server Express needs certain conditions to be met. Int his case, theya re not set correctly by Plesk.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Basically, the application pool worker user ID appears to not have a local profile. Is this right?

Thanks!
 
Nothing/ No reply?

You know, I really LIKE Plesk, but the lack of support from SWSoft is really, really a pain in the ***.
 
SQL Express user instance

The situation you are asking about is pretty complex to implement. The reason the local development environment works so well with a local SQL Express database file is because you are logged in as a local user. You are right that the account Plesk is using just needs a local profile, which requires the account to have been logged in (initialized). That would mean creating a user account for Plesk (and having logged in with it). There are security issues with having a setup like this as well as the complexity.
The short answer is that this is much harder to implement (maybe impractical) and the proper environment is to run the SQL Express server. This is a minor short-term inconvenience for a software developer (I am one) but has benefits long-term because you have a server instead of having a local file. If you are the only person working on a project it's fine, otherwise having the database server is much better than a local SQL Express file.

If you want, you can even Attach the SQL Express file by copying it onto your VPS and attaching it in SQL Express. Once it's attached, just modify your Web.config to point to your VPS domain name or VPS IP address (and instance name if one i.e. yourdomainname.com\SQLEXPRESS or 12.12.12.12\SQLEXPRESS)
You can either override the LocalSqlServer connection string (a built in default that can be changed by removing and re-adding the key with 2 lines in your web.config) or you can create your own connection new string and use that (preferable).

Working against a SQL Express instance is usually preferable so if you get used to this it is better overall. The Visual Studio built-in support for a SQL Express data file is something they included for rapid local development and not really for deployment. Technically you can also deploy the SQL Express file onto a MS based website too by forcing the website to use a local user account for anonymous authentication but again this is not really a normal environment.

Trying to use User Instancing on a web farm would be even worse. Not that you would use SQL Express as a backend for a website on a farm. At some point you would need to stop using the SQL Express data file anyways, so it is really better to start without it. Once your initial framework is built you should switch it to a server-based backend and continue from there.

I hope this answers some of your questions.
 
Back
Top