logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

ASP.NET - Błąd połączenia z DB MySQL po wrzuceniu strony na myasp.net

jaja11jaja 01 Lis 2015 17:17 1620 18
REKLAMA
  • #1 15113872
    jaja11jaja
    Poziom 8  
    Posty: 15
    Usiłuję się połączyć z DB MySQL serwera.

    ConnectionString wygląda tak :"Server=MYSQL5012.myASP.NET;Database=db_9df278_ms;Uid=9df278_ms;Pwd=YOUR_DB_PASSWORD;"

    PO WRZUCENIU STRONY NA SERWER ASP (dokładnie myasp.net)

    Dostaję:
    Cytat:

    Server Error in '/' Application.

    The system cannot find the file specified

    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: System.ComponentModel.Win32Exception: The system cannot find the file specified

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [Win32Exception (0x80004005): The system cannot find the file specified]

    [SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +92
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType) +372
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +172
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +818
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +320
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken) +591
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +304
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +681
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +89
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +426
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +191
    System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +154
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +21
    System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +90
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +166
    System.Data.SqlClient.SqlConnection.Open() +96
    Dziennik2.WebForm2.BindData() in c:\Users\admin\Documents\Visual Studio 2012\Projects\Dziennik2\Oceny.aspx.cs:22
    Dziennik2.WebForm2.Page_Load(Object sender, EventArgs e) in c:\Users\admin\Documents\Visual Studio 2012\Projects\Dziennik2\Oceny.aspx.cs:16
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
    System.Web.UI.Control.OnLoad(EventArgs e) +95
    System.Web.UI.Control.LoadRecursive() +59
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678




    Co jest kurna nie tak ?
  • REKLAMA
  • #2 15113894
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    Zwróć uwagę na to zdanie: ... Verify that the instance name is correct and that SQL Server is configured to allow remote connections ...
  • #3 15113912
    jaja11jaja
    Poziom 8  
    Posty: 15
    -psiak- napisał:
    Zwróć uwagę na to zdanie: ... Verify that the instance name is correct and that SQL Server is configured to allow remote connections ...


    Wybacz, ale nie wiem do czego dążysz i jak mam to sprawdzić

    Connection String generuje serwer, jak mam tam Bazy Danych, wybieram jaką chcę , wybieram MySQL i mam moje dane do połączenia się z phpMyAdmin i pisze tam: connectionString jak na to nacisnę to tworzy mi się connection który podałem , moją rolą jest tylko wpisanie hasła do bazy .

    A co do połączeń zdalnych, to od kiedy istnieją one między serwerem a MySQL ? bo jeżeli tak to jak ja mam to zrobić ....
  • REKLAMA
  • #5 15113975
    jaja11jaja
    Poziom 8  
    Posty: 15
    Chyba się nie zrozumieliśmy.

    MySQL nie stoi u mnie na komputerze ... tylko gdzieś w chmurze .
  • #6 15114010
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    No więc sprawdź czy przyjmuje połączenia zewnętrzne, jeżeli nie przyjmuje to znaczy że źle skonfigurowany.
  • REKLAMA
  • #8 15114066
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    Czegoś nie rozumiem, w przykładzie masz połączenie do lokalnego serwera, zaś powiedziałeś że baza danych jest w chmurze (czyli nie lokalna).
    Więc jeszcze raz wytłumacz z jaką bazą chcesz się połączyć z lokalną czy z tą w chmurze?
  • #9 15114377
    jaja11jaja
    Poziom 8  
    Posty: 15
    Nie działa SQL ... działa lokalnie na IIS .

    Dostaję teraz takie błędy:

    Cytat:

    The system cannot find the file specified

    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: System.ComponentModel.Win32Exception: The system cannot find the file specified

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [Win32Exception (0x80004005): The system cannot find the file specified]

    [SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +92
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType) +372
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +172
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +818
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +320
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken) +591
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +304
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +681
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +89
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +426
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +191
    System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +154
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +21
    System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +90
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +166
    System.Data.SqlClient.SqlConnection.Open() +96
    Dziennik2.WebForm2.BindData() in c:\Users\admin\Documents\Visual Studio 2012\Projects\Dziennik2\Oceny.aspx.cs:22
    Dziennik2.WebForm2.Page_Load(Object sender, EventArgs e) in c:\Users\admin\Documents\Visual Studio 2012\Projects\Dziennik2\Oceny.aspx.cs:16
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
    System.Web.UI.Control.OnLoad(EventArgs e) +95
    System.Web.UI.Control.LoadRecursive() +59
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
  • REKLAMA
  • #11 15114526
    jaja11jaja
    Poziom 8  
    Posty: 15
    I ja dalej nie wiem o co chodzi .........
  • #13 15114578
    jaja11jaja
    Poziom 8  
    Posty: 15
    Powiedz normalnie a nie się bawisz .

    Nie WIEM jak mam się połączyć z tą (...) bazą . Napisałem temat z nadzieją, że ktoś mi powie:

    TAK O TO .
    A nie będzie się bawił w linki jak Ty z których tych linków ... znalazłem nie to co potrzebuję.

    Sam też nie znalazłem tego co potrzebuje bo każdy się łączy z lokalną bazą ....
  • #14 15114603
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    Nie musisz się denerwować, wystarczy że powiesz którego słowa nie rozumiesz w zdaniu:
    -psiak- napisał:
    No więc sprawdź czy (serwer bazy danych) przyjmuje połączenia zewnętrzne, jeżeli nie przyjmuje to znaczy że źle skonfigurowany.
  • #15 15114608
    jaja11jaja
    Poziom 8  
    Posty: 15
    Jak mam to niby sprawdzić ? .
  • #16 15114642
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    Na przykład za pomocą standardowego mysql klienta dostarczanego razem z instalacją MySQL, albo prawie dowolny MySqlAdmin.
    Oczywiście również polecam: http://bfy.tw/2Zi8
  • #17 15114752
    jaja11jaja
    Poziom 8  
    Posty: 15
    Poddaję się. Nie wiem i tak jak to zrobić .
  • #18 15114796
    -psiak-
    Poziom 32  
    Posty: 1185
    Pomógł: 259
    Ocena: 107
    Zacznij od dostania się do bazy danych jakimś standardowym programem dla pracy z bazą danych.
    Jeżeli to się nie uda to rozmawiaj z administratorem serwera na temat dostępu do bazy.
    Jeżeli się uda to czytaj uważnie pierwszy z linków: http://bfy.tw/2Zi8
  • #19 15114833
    jaja11jaja
    Poziom 8  
    Posty: 15
    Kwestia tego, że z poziomu lokalnego IIS się dostałem do bazy...

    A jak wrzucam stronę na serwer, to juz tego dostepu nie mam.

Podsumowanie tematu

✨ Użytkownik napotkał problem z połączeniem do bazy danych MySQL po wrzuceniu strony na serwer myASP.NET. ConnectionString był generowany przez serwer, jednak po próbach okazało się, że serwer nie akceptuje połączeń zdalnych. Po wymianie informacji, użytkownik odkrył, że użycie innego connection stringu, znalezionego na stronie CodeProject, rozwiązało problem. Dyskusja dotyczyła również kwestii dostępu do bazy danych w chmurze oraz lokalnych ustawień serwera IIS.
REKLAMA