• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Connect Remotely To The WordPress MySQL Database

Bhagwad Park

Published on: August 13, 2018

Categories: WordPress 5

Updated: May 1, 2023

WordPress lives in its database. The files and folders on your server are for appearances only. CSS, Javascript, and PHP files can usually be replaced from other sources. But your content – that is what makes your site special and unique. And that content lives in the database. If you had to pluck out one component of your WordPress site and carry it with you, it would be the MySQL database.

In this article, I’ll show you how to connect to MySQL remotely. While it’s possible to do this from cPanel using phpMyAdmin, it’s a bit clumsy and requires you to go through several steps each time. By accessing the database from a local client, you can do things faster, and also set up complex operations like schedules etc. So let’s get started.

Table of Contents
  • Step 1: Download and Install HeidiSQL
  • Step 2: Gather the Necessary Information
    • Get the Database Username and Password
    • Get your Hostname or IP Address
    • Get your Local IP Address
  • Step 3: Setting up Remote MySQL Access
  • Step 4: Set up a New Session with HeidiSQL

Step 1: Download and Install HeidiSQL

When it comes to the choice of MySQL clients, my vote goes to HeidiSQL. It’s smaller and less cumbersome than the MySQL workbench, so that’s what I’ll use in this tutorial. It’s free and open source – what’s not to love? You can download it from here. It’s also available in the Windows store, so if you’re on Windows 10, it might be easier to get it from there.

Step 2: Gather the Necessary Information

To make a remote connection to your MySQL database, you need the following pieces of information:

  1. Your database username
  2. Your database password
  3. The server hostname or IP address
  4. Your LOCAL IP address from which you will access the server

Get the Database Username and Password

Go into your WordPress root folder and open the file called “wp-config.php”. Here, you will find your database username and password as shown here:

Get the Database Name

Get your Hostname or IP Address

Log into the cPanel interface of NameHero, and you will see your primary domain on the right-hand side as shown here. We’ll use this as the hostname. You can also click the “Server Information” link on the bottom to get the IP address instead.

Get your Local IP Address

This is easy. Go to google.com, and type in “what is my ip”. Google will respond with the IP address of your local system as shown here:

Get your IP Address

Step 3: Setting up Remote MySQL Access

By default, servers don’t allow remote access to their databases except from specific IP addresses. So we need to add our IP address to the whitelist.

Log into your cPanel, and find the icon titled Remote MySQL as shown here:

Remote MySQL Database in cPanel

In the following screen, add the LOCAL IP address you got in step 2 and click “Add Host”.

Add Access Host

You should see a confirmation screen as shown here:

Access Host Added

Now we have permissions for remote access. Keep in mind that your local IP address can change at the whims of your ISP. It may not happen often, but it can happen. Also if you connect through a VPN, the IP address will change as well. So take all this into consideration!

Step 4: Set up a New Session with HeidiSQL

Open HeidiSQL and click “New” at the bottom left as shown here:

Create a New Session in HeidiSQL

Enter a name for the new connection on the left-hand panel. On the right, enter the credentials you got in step 2. Namely, the IP address or hostname, your username, and the password for your database.

Enter Database Credentials

Now click the “Save” button for the session. Once done, click “Open”.

If all goes well, it should initiate a remote MySQL connection to your database as shown here:

Connect Remotely to the WordPress MySQL Database

It will display a list of all the databases attached to your account. From here, you can run SQL queries, view data, take backups and restore stuff with the click of a button. It’s much faster and easier to access than phpMyAdmin!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

Joomla vs. WordPress: Which One Is Better?

In this post, we’ll consider five differences between Joomla and WordPress and how you might go forward with setting up a WordPress website.

What Is Self-Hosted WordPress?

In this post, we’ll differentiate self-hosted WordPress from WordPress.com, and discuss the benefits of the former.

How To Back Up Your WordPress Site (And Why You Should Do It Today)

In this post, we’ll take a closer look at why backups matter. We’ll also show you different ways to back up your WordPress website.

Blogger vs. WordPress: Which One to Use?

Let's compare WordPress and Blogger across five key areas. Then, we'll show you how to set up a professional blog with WordPress.

Reader Interactions

Comments

  1. Bobby says

    May 25, 2019 at 5:12 pm

    Good day, I tried but no luck. So the wordpress site installed on windows server 2016. The mysql database is stored on the c drive of the server. I tried your method using domain name and ip address and they came up nothing.

    Reply
    • Ryan Gray says

      May 27, 2019 at 11:36 am

      Unfortunately I’ve never connected it to a Windows server, what is the error it’s kicking?

      Reply
  2. Peter says

    February 25, 2021 at 11:10 am

    Nicely explained. Though I use another DB client, pretty straight forward and works well. Thanks for the guidance.

    Reply
  3. Anwar Ahmed says

    April 26, 2024 at 10:29 pm

    HI,

    I am looking for a post of wordpress developer

    AND intersted to be part of your company

    Looking forward for a positive response

    Thanks and Regards

    Anwar

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA