Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

An error occurs while deploying a database from WebMatrix


Symptoms

When publishing or downloading a site containing a database using WebMatrix, an error message similar to the following may be displayed in the notification bar:



“Publish: Error – Unable to publish”



Clicking the Log link shows details similar to the following, indicating that the database could not be created:


12:00:00 PM: The database 'my_db' could not be created. 12:09:23 PM: Retrying operation 'Add' on object dbFullSql 
(database=my_db;user id=my_username;server=my_db_server). Attempt 1 of 2.
12:00:00 PM: An error occurred during execution of the database script. The approximate location of the error was 
between lines '530' and '541' of the script. The verbose log may have more information about the error.

↑ Back to the top


Cause

There a are a variety of reasons why these problems can occur. For more information, please see the Resolution section below.


↑ Back to the top


Resolution

Database transfers can fail for a variety of reasons. Please try these steps in sequence and try publishing again:

1) Make sure you have a valid database connection string. Click ‘Validate Connection’ in the Publish Settings dialog box to check that this is a valid connection string.

a. If you are publishing a site that contains a SQL Server database, you need a connection string for a SQL Server database.


b. If you are publishing a site that contains a MySQL database, you need a connection string for a MySQL database.


c. If you are publishing a site that contains a SQL Server Compact database, you do not need a connection string because this database will be published as a file.




2) If you are publishing a site containing a MySQL database:

a. Check that you have MySQL Server installed on your computer.


b. Check that the default collation of your MySQL Server is UTF-8. When WebMatrix installs MySQL Server, it specifies that this character set should be used; if you installed MySQL Server on your own, you may need to specify this configuration setting yourself:




3) Your web hosting provider also needs to have SQL Server or MySQL Server installed and configured appropriately.




↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2493971
Revision : 1
Created on : 1/7/2017
Published on : 1/10/2011
Exists online : False
Views : 93