Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To connect to MySQL from another computer, you need the server’s reachable hostname or IP address, port, a MySQL account permitted to connect from your client’s host, and a network route to the server. From a terminal, use mysql -h HOST -P PORT -u USER -p; replace the uppercase values with details from your database administrator or hosting provider. The client prompts for your password instead of exposing it in the command.

What you need before connecting

  • Host: the database hostname or IP address reachable from your computer. A private endpoint may only work from an approved network or VPN.
  • Port: the configured MySQL TCP port. MySQL’s default is 3306, but a provider or administrator may configure another port.
  • Credentials: your MySQL username and password, plus permission for that account to connect from your client’s host.
  • Client: a MySQL command-line client or another compatible database client.
  • Connection policy: any provider firewall rules, required TLS settings, CA certificate, or SSH tunnel details.

Ask your administrator or provider for the actual endpoint, port, allowed source network, account permissions, and encryption requirements. These values depend on the deployment; there is no universal remote host or port to use.

Connect with the MySQL command-line client

  1. Open a terminal on the computer that will connect to the database.
  2. Run mysql -h HOST -P PORT -u USER -p, substituting the supplied hostname or IP, port, and username. The -P option specifies the port; if the server uses the default 3306, it can usually be omitted.
  3. When prompted, enter the MySQL account password. The prompt does not echo the password.
  4. After a successful connection, the client displays a MySQL prompt. If it fails, use the error message to follow the relevant troubleshooting section below.

MySQL documents the basic form as mysql -h host -u user -p in its MySQL 8.4 client connection documentation. Avoid putting the password directly in the command line: it can be exposed through process information or shell history.

Check that the server and network allow remote TCP/IP

A valid account cannot connect if the server is not listening on a reachable network interface or the route is blocked. On the server side, the MySQL service must accept TCP/IP. The skip_networking setting disables network TCP/IP connections; a bind_address of 127.0.0.1 listens only on loopback, so remote computers cannot reach it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

MySQL’s 8.4 troubleshooting documentation states that a server bound to 127.0.0.1 listens for TCP/IP only locally and does not accept remote connections. See Troubleshooting Problems Connecting to MySQL. Do not change the bind address or expose a database port publicly without the server owner’s approval and a network security plan.

  • Confirm the hostname resolves to the intended server and that the client can reach the appropriate network or private endpoint.
  • Confirm the MySQL service is running and listening on the configured port.
  • Check server, operating-system, cloud, and intervening network firewalls. Each must permit the intended client source to reach the MySQL port.
  • Use the provider’s endpoint and access rules; a public address may not be enabled, and private services may require a VPN, peering, or an approved network location.

Make sure the MySQL account permits your client host

MySQL authorization depends on both the account name and the host from which the client connects. An account that works on the database server itself may not match a remote connection from your workstation or application host. Ask the database administrator to verify that the intended account exists for the source host, has the required privileges, has a valid password, and is not locked. MySQL describes account names and host matching in its account name documentation.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Do not solve a remote access problem by granting unrestricted host access or broad privileges. Have the administrator permit only the necessary source host or network and grant only the database privileges the workload needs.

Protect the connection with TLS or an SSH tunnel

TLS encryption and server identity

TLS encrypts traffic between client and server. Encryption and identity verification are distinct: requiring an encrypted connection does not necessarily prove that the client reached the intended server. For MySQL 8.4, the manual documents TLS 1.2 and TLS 1.3 support. Follow the provider’s instructions for its trusted CA certificate and use hostname verification where supported, such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

mysql -h HOST -P PORT -u USER -p --ssl-mode=VERIFY_IDENTITY --ssl-ca=/path/to/ca.pem

Replace the CA path with the certificate file supplied or designated for your service. The hostname used with -h must match the server identity in its certificate for identity verification to succeed. MySQL’s connection options documentation explains SSL modes: PREFERRED may fall back to an unencrypted connection, while REQUIRED requires encryption but does not itself verify server identity. An administrator can also enforce secure transport with require_secure_transport or require SSL for an account.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

SSH tunnel when direct inbound access is unsuitable

An SSH tunnel can carry the database connection through a host you are authorized to reach, avoiding direct inbound exposure of MySQL to your client network. The tunnel endpoint must itself be reachable, and the SSH host must be able to reach the database endpoint. This adds SSH setup and operational dependencies; it does not automatically configure end-to-end MySQL TLS certificate verification. MySQL documents remote connections from Windows using SSH in its SSH connection instructions. Exact commands depend on the SSH host, local port, and client configuration, so use values and steps provided for your environment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a failed remote connection

Connection times out or is refused

  • Verify the hostname or IP and configured port with the administrator or provider.
  • Check that the server is available and listening for TCP/IP, and that skip_networking is not preventing network access.
  • Check whether bind_address limits the server to loopback or another unreachable interface.
  • Confirm the client’s network route and every relevant firewall or provider access rule allow traffic from the client to the MySQL port.

“Access denied”

  • Check that you used the correct MySQL username and password.
  • Ask the administrator to confirm the account is unlocked and that its host component matches the location from which you connect.
  • Confirm the account has the required privileges; do not broaden access as a shortcut.

TLS or certificate error

  • Confirm the client and server support a mutually permitted TLS version.
  • Check that the specified CA file exists, is readable, and is the correct CA for the database service.
  • With VERIFY_IDENTITY, connect using the hostname represented by the server certificate; an IP address or different alias may not match.
  • Ask the provider or administrator whether secure transport is mandatory and which client options it requires.

Unknown host or port

Do not guess. Get the deployment’s actual hostname, port, endpoint type, and client access rules from its administrator or provider. The MySQL default port is 3306, but that does not establish that a particular server uses it or is reachable from your network.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.