Network Issue CS2

CS2: CreateBoundSocket Bind Error & MySQL Connection Failure - Fix Guide

📅 Published: 2026-02-05 🔄 Updated: 2026-02-05 👥 Reports: 0 ⚡ Severity: 🟢 Low

🎯 Quick Answer

This error indicates a local database service failure; the primary fix is to verify and start the MySQL or MariaDB Windows service to resolve the port binding and connection issues.

SECTION 1: OVERVIEW

This error condition represents a compound failure in a Counter-Strike 2 (CS2) server environment utilizing SourceMod plugins. The primary error, CreateBoundSocket: ::bind to port 0 returned error [no name available](10049), indicates the server's inability to bind a network socket to a specified port, often a fallback or misconfiguration. The subsequent error, [admin-sql-prefetch.smx] Could not connect to database "default": [2003]: Can't connect to MySQL server on 'localhost' (10061), is the root technical failure. Error 10061 is a Windows Sockets error code for "Connection refused," meaning the TCP connection attempt to the MySQL database service on localhost (127.0.0.1) was actively rejected because no service is listening on the default port 3306. This problem occurs exclusively on Windows-based CS2 dedicated servers running SourceMod with database-dependent plugins. It is common in privately hosted servers where database services are manually managed. The severity is game-breaking for server administrators, as plugins requiring database access will fail to load or function, potentially crippling server administration, statistics, or item systems. The exact error codes present are 10049, 2003, and 10061.

SECTION 2: SYMPTOMS

The application logs the error sequence in the addons/sourcemod/logs/ directory, typically in an error_*.log file. The server console or log file displays the exact lines: L 10/02/2021 - 18:23:22: [admin-sql-prefetch.smx] Could not connect to database "default": [2003]: Can't connect to MySQL server on 'localhost' (10061). This is often preceded by the CreateBoundSocket error. Observable symptoms include the failure of SourceMod plugins that rely on database functionality, such as admin authentication, player statistics, or item stores. These plugins may not load, or may generate continuous error messages. The server itself remains running, but core administrative features are non-functional. The error occurs during server startup or map change when plugins attempt to initialize and prefetch data from the configured database.

SECTION 3: COMMON CAUSES

Category: Service Configuration Error Specific technical explanation: The MySQL (or MariaDB) Windows service is not running. The database server process must be actively listening on TCP port 3306 (default) to accept connections. Error 10061 confirms the TCP SYN packet was met with an RST (reset) packet, indicating no listening socket exists on that port. Why this causes the problem: The SourceMod plugin attempts to connect to localhost:3306 but the connection is refused, causing the plugin initialization to fail. Category: Configuration Error Specific technical explanation: Incorrect credentials or database name in the addons/sourcemod/configs/databases.cfg file. The connection parameters defined for the "default" database entry do not match the actual database setup on the MySQL server. Why this causes the problem: Even if the MySQL service is running, the plugin cannot authenticate or locate the specified database, resulting in a connection failure that may manifest similarly. Category: Network Problem Specific technical explanation: A local firewall rule (Windows Defender Firewall or third-party) is blocking the MySQL server executable (mysqld.exe) or port 3306 from accepting loopback (127.0.0.1) connections. Why this causes the problem: The TCP connection from the CS2 server process (srcds.exe) to the MySQL process is blocked at the network layer, preventing successful socket communication. Category: Software Conflict Specific technical explanation: Another application or service is already bound to TCP port 3306 on the local machine, preventing the MySQL service from starting or listening. Why this causes the problem: The MySQL service fails to initialize its network socket, leaving no endpoint for the game server to connect to. Category: Configuration Error Specific technical explanation: The MySQL server is configured to not listen on the TCP/IP port, or is configured to listen only on a specific network interface (e.g., 192.168.1.100) instead of all interfaces or localhost (127.0.0.1). This is controlled by the bind-address directive in the my.ini or my.cnf configuration file. Why this causes the problem: The server is not accepting connections on the loopback adapter, making localhost or 127.0.0.1 unreachable. Category: Game Bug / Plugin Issue Specific technical explanation: An outdated or corrupted version of the admin-sql-prefetch.smx plugin or its dependencies. The plugin may contain a hard-coded connection string or method incompatible with the installed database server version. Why this causes the problem: The plugin itself generates malformed network requests or uses deprecated authentication protocols, leading to a connection refusal.

SECTION 4: SOLUTIONS

Solution 1: Start the MySQL Windows Service

Difficulty: Easy Time Required: 2 minutes Success Rate: High Prerequisites: Administrator access to the server. Steps: Technical Explanation: This ensures the mysqld.exe process is running and has successfully bound to its configured TCP port (default 3306), creating a listening socket that can accept the incoming connection from the CS2 server process. Verification: Re-launch the CS2 dedicated server and monitor the console or logs. The Can't connect to MySQL server on 'localhost' (10061) error should no longer appear. The admin-sql-prefetch.smx plugin should report a successful connection or load without error.

Solution 2: Verify Database Configuration in SourceMod

Difficulty: Medium Time Required: 5 minutes Success Rate: High Prerequisites: Knowledge of database credentials. Steps: ` "default" { "driver" "mysql" "host" "localhost" "database" "sourcemod" "user" "root" "pass" "" // "port" "3306" } ` Technical Explanation: This confirms the connection parameters used by the plugin are accurate. An incorrect password or database name will lead to authentication failure, which can sometimes produce a similar network error. Verification: After server restart, check for new error messages. A successful connection will show no related errors. An authentication error will change from (10061) to an access-denied message (e.g., ERROR 1045), indicating the service is running but credentials are wrong.

Solution 3: Configure MySQL Server Bind Address and Port

Difficulty: Advanced Time Required: 10 minutes Success Rate: High Prerequisites: MySQL server installed, access to its configuration file. Steps: Technical Explanation: The bind-address directive controls which network interfaces the MySQL server listens on. If set to a specific IP other than the loopback address, connections to localhost will fail. Setting it to 127.0.0.1 ensures it accepts local connections. Verification: Open Command Prompt as Administrator and run netstat -an | findstr :3306. You should see a line like TCP 127.0.0.1:3306 0.0.0.0:0 LISTENING. This confirms MySQL is listening on the correct interface.

Solution 4: Create Windows Firewall Allow Rule

Difficulty: Medium Time Required: 5 minutes Prerequisites: Administrator access. Steps: Technical Explanation: This creates an explicit permit rule for TCP port 3306, ensuring the Windows firewall does not block the loopback connection between srcds.exe and mysqld.exe. While loopback traffic is often allowed, restrictive firewall configurations can block it. Verification: Temporarily disable the firewall (for testing only) via the same wf.msc console. If the CS2 server error disappears, the firewall was the cause. Re-enable the firewall and confirm the new rule allows the connection.

Solution 5: Repair or Reinstall Database Plugin

Difficulty: Easy Time Required: 3 minutes Success Rate: Medium Prerequisites: Access to server files. Steps: Technical Explanation: A corrupted plugin binary may have internal logic errors that prevent proper socket creation or connection handling. Replacing it eliminates this variable. The CreateBoundSocket error may originate from within the plugin's attempt to create a secondary network socket. Verification: The server log should no longer contain the specific [admin-sql-prefetch.smx] error line. If the error persists, the issue is environmental, not plugin-specific.

Solution 6: Test Database Connectivity Externally

Difficulty: Advanced Time Required: 5 minutes Success Rate: High (Diagnostic) Prerequisites: MySQL client tools installed (e.g., mysql.exe in PATH). Steps: Technical Explanation: This diagnostic sequence isolates the problem. Step 2 tests the network socket, separating it from authentication issues tested in Step 4. It confirms whether the failure is at the transport layer (TCP) or the application layer (MySQL protocol). Verification: A successful telnet connection