Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the port number of MySQL connection string database server under C #

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what is the MySQL connection string database server port number under C #". In the daily operation, it is believed that many people have doubts about what the MySQL connection string database server port number is under C #. The editor consulted all kinds of materials and sorted out a simple and useful operation method. I hope it will be helpful to answer the question of "what is the port number of the MySQL connection string database server under C#"! Next, please follow the editor to study!

Normal MySQL connection string configuration under C #, this is when the MSSQL server port is 1433 (default).

However, sometimes, for the security of the database server, this port will be changed to something else. If you use the MySQL connection string under this C#, the following error may be reported when connecting to the database:

An error occurred while establishing a connection to the server. When connecting to SQL Server 2005, SQL Server does not allow remote connections by default, which may cause this failure. (provider: named pipe provider, error: 40-connection to SQL Server cannot be opened)

At this point, you just need to add the port number:

Port modification method of MySQL connection string under C#:

"start"-- > "Server Network Utility"-- > tcp/ip-- > default port: 2433 (others are fine)

StateServer session Management

Set the mode property to StateServer, which stores the session data in a separate memory buffer, which is controlled by the Windows service running on a single machine. The full name of the status service is "ASP.NET State Service" (aspnet_state.exe), which is configured by the stateConnectionString property in the Web.config file. This property specifies the server on which the service resides and the port to monitor:

In this example, the state service runs on port 42424 (the default port) of a machine named myserver. To change the port on the server, edit the Port value in the HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ aspnet_state\ Parameters registry key. Obviously, the advantage of using stateful services is that processes are isolated and can be shared in Web farm. Using this mode, the storage of session state will not depend on the failure or restart of the iis process. However, once the state service is aborted, all session data will be lost. In other words, the state service does not persist data like SQL Server; it just stores the data in memory.

Unable to make a session state request to the session state server. Make sure that ASP.NET State Service (ASP.NET status Service) is started and that the client port is the same as the server port. If the server is on a remote computer, check

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ aspnet_state\ Parameters\ AllowRemoteConnectio

N to ensure that the server accepts remote requests. If the server is on the local computer and the registry value mentioned above does not exist or is set to 0 (if changed to 1, remote connections are accepted), the status server connection string must use "localhost" or "127.0.0.1" as the server name.

At this point, the study on "what is the port number of the MySQL connection string database server under C #" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report