Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bryan 3 posts 64 karma points
    Nov 07, 2014 @ 19:20
    Bryan
    1

    MySQL Connection error for site that doesn't Use MySQL

    I'm new to Umbraco and iIve been trying to get a new site up. Whenever I try to Publish a document, I get the following error.

    Unable to connect to any of the specified MySQL hosts.

    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. 

    Exception Details: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. 

    Stack Trace: 

    at MySql.Data.MySqlClient.NativeDriver.Open()
       at MySql.Data.MySqlClient.Driver.Open()
       at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
       at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
       at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
       at MySql.Data.MySqlClient.MySqlPool.GetConnection()
       at MySql.Data.MySqlClient.MySqlConnection.Open()
       at MySql.Web.Common.SchemaManager.GetSchemaVersion(String connectionString)
       at MySql.Web.Common.SchemaManager.CheckSchema(String connectionString, NameValueCollection config)
       at MySql.Web.SiteMap.MySqlSiteMapProvider.Initialize(String name, NameValueCollection config)
       at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)

     

    the problem is I'm not Useing a MySQL database.  I'm Using a MS SQL database.  I've been searching around and I can't seem to find any one who's had this problem before.  All other functions of the website work just fine.  and after attempting to Publish a document, the document properties for the "Link to Document" show as 

    I've Installed Umbtaco 7.1.8 from the Webplatform Installer and From Nuget. 

    I can install one of the default templates and the whole site works fine unless I try to publish a new document.

    If i start from a New site I can made the first root document at ~/  but then all other documents fail to publish.

    I do have the MySQL for Visual Studio, MySQL .Net Connector, and MySQL ODBC Connector installed for an unrelated project.  But i'd like to see all my options before I remove them.

    My connection string bellow

    <connectionStrings>

        <remove name="umbracoDbDSN" />

        <add name="umbracoDbDSN" connectionString="server=BRYAN-LAPTOP\SQLEXPRESS;database=UmbracoTemplate;user id=UmbracoTemplate;password=****" providerName="System.Data.SqlClient" />

      </connectionStrings>

  • Bryan 3 posts 64 karma points
    Nov 07, 2014 @ 22:42
    Bryan
    1

    welp,

    Uninstalling MySQL for Visual Studio, MySQL .Net Connector, and MySQL ODBC Connector worked.

    I don't know which one the culprit is though.

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Nov 07, 2014 @ 22:43
    Dennis Aaen
    0

    Hi Bryan and welcome to our,

    I know that if you see the minium system requirements here http://our.umbraco.org/documentation/Installation/system-requirements for Umbraco 7, it says that you could use a MySQL datbase, but I think tthe truth is that this database has not gotten much attention, and especially not after the SQLCE database become available to use when Umbraco. 

    So my advice to you is that to use a Microsoft SQL database, or to use the bult in SQLCE database, and since you are using the Umbraco 7, then installer is setup to use the SQLCE default, but as you already has discovered you can change it to use another database.

    I know that is not the answer that you was hoping for.

    Hope this helps, anyway.

    /Dennis

  • Bryan 3 posts 64 karma points
    Nov 07, 2014 @ 22:53
    Bryan
    0

    Thanks for the reply

    But was using Microsoft SQL for a database connection and getting MySQL errors.

    It looks like though that the MySQL connectors I had installed where sneaking into my .Net

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 08, 2014 @ 09:15
    Jan Skovgaard
    0

    Hi Bryan

    Sounds like an issue with the 3rd party software rather than Umbraco itself. Do you have other .NET based applications running, that don't rely on Umbraco? If so did you ever experience the issue on those? If the issue is related to Umbraco it's something that should be filed as an issue on the issue tracker I think.

    But I suspect this is something that would happen outside an Umbraco context as well though.

    But glad you managed to get up and running :)

    Happy Umbracoing.

    /Jan

  • Mike 10 posts 73 karma points
    Nov 18, 2014 @ 01:44
    Mike
    0

    I'm getting this exact same problem. I have installed umbraco using SQLCE, not mysql. When I create a new content item I get the same error as above. I noticed that the content Items are created if I refresh.

    I do have mysql installed for other projects so the data providers would be installed in the machine.config. Is umbraco doing something weird were its grabbing a data provider from the machine config or something? 

    (See Attached)

     

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Nov 18, 2014 @ 01:53
    Nicholas Westby
    0

    I had a very similar issue. The fix was to run the MySQL installer and have it uninstall the .NET Connector for MySQL: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/58112-Cant-publish-due-to-MySqlWebv20

    The issue is apparently that the installer modifies your machine.config, which may affect any .NET project.

  • Mike 10 posts 73 karma points
    Nov 18, 2014 @ 02:13
    Mike
    0

    Done some more digging looks like the bug is in umbraco.presentaion\content.cs ln 368:

     

    I know nothing of the umbraco source but looks like the SiteMap provider is doing something weird, I'll keep digging. If anyone know anyone on how this Sitemap provider is working please chime in

  • Mike 10 posts 73 karma points
    Nov 18, 2014 @ 02:23
    Mike
    113

    Looks like the issue is with MySql installing a default siteMap provider in the machine config:

        <siteMap>

          <providers>

            <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />

          </providers>

        </siteMap>  

    ** TO FIX **

    Add the following to your umbraco web.config under the system.web section:

    <siteMap>      

    <providers> <remove name="MySqlSiteMapProvider" />  </providers>

    </siteMap>

     

    Someone should probably log this as a MySql bug

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    Jul 24, 2015 @ 07:59
    Paul Seal
    0

    Thank you so much.

    I was having this problem too and this solved it instantly.

  • Jonas Eriksson 930 posts 1825 karma points
    Mar 27, 2015 @ 15:47
    Jonas Eriksson
    0

    Solved my issue - was going crazy - could not publish nodes in a new installation because of this. Thanks a lot for providing the fix Mike.

    / Jonas

  • Marcin Zajkowski 112 posts 585 karma points MVP 6x c-trib
    May 05, 2015 @ 17:35
    Marcin Zajkowski
    0

    I was also fighting with this issue. Shame that I can't upvote yet, but Mike - you have my upvote when I reach minimum karma level :) Thank you! #hi5yr

  • Ehsan 8 posts 30 karma points
    May 08, 2015 @ 05:52
    Ehsan
    1

    BIG THANKS TO MIKE !

    I was very close to change the Hosting Company I'm with.

    Placing the following in the web.config fixed it!

    <siteMap>    <providers> <remove name="MySqlSiteMapProvider" />  </providers> </siteMap>
    
  • jake williamson 207 posts 872 karma points
    Jun 11, 2015 @ 09:10
    jake williamson
    0

    chaps, i found this post after going through a world of pain with the exact same issue re umbraco busting after installing mysql...

    although the web.config update at a site level fixes the problem, i'm now in the tricky situation of ALL of the umbraco sites i run on my machine failing!

    i can go through an update all the web.configs but this is confusing to the other devs who don't have mysql installed and are questioning why this setting is even in there...

    does anybody know of a machine level fix for this?! i'm hunting around at the mo but though i'd pop the question here ;)

    cheers,

    jake

  • Chris 34 posts 134 karma points
    Jun 18, 2015 @ 14:37
    Chris
    0

    Same issue, was using MS SQL server but installed MySql onto my workstation that caused this.

    Adding the extra xml tag to web.config as described fixed it

  • hernan 1 post 21 karma points
    Jul 14, 2015 @ 04:10
    hernan
    0

    Thank you very much.The problem was solve Ok Uninstalling the Conectors!!!

  • mellogrand 4 posts 25 karma points
    Oct 07, 2015 @ 10:06
    mellogrand
    0

    Same issue starting fron github code with Visual Studio. MySql gets around even if I work and setup web.config for SQL Server. fix works, but is there any action taken from Umbraco to solve this ?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Oct 27, 2015 @ 10:04
    Sebastiaan Janssen
    2

    @mellogrand Yes, this is being fixed for 7.3.1: http://issues.umbraco.org/issue/U4-6125

    So the web config snippet will be added by default as of 7.3.1!

  • Sumesh KP 34 posts 107 karma points c-trib
    Jun 25, 2018 @ 09:06
    Sumesh KP
    0

    @mike

    Your solution saved me :)

Please Sign in or register to post replies

Write your reply to:

Draft