Blog
SavedSearch
Visit Hostlelo

cPanel 138 Rejects IPs With Leading Zeros: Fix Remote MySQL

cPanel 138.0.28 rejects IPv4 hosts like 192.168.001.010. Find the IP your MySQL server sees, add it in plain form, and confirm the login in minutes.

The short answer

Since cPanel 138.0.28 (19 November 2026), Remote Database Access rejects IPv4 addresses with leading zeros, so 192.168.001.010 must be entered as 192.168.1.10. MySQL compares host values as strings, so a padded entry would not match the real client anyway. Read the client IP from the MySQL error, add it in plain form in cPanel or WHM, and confirm with SELECT USER(), CURRENT_USER().

Reading options

On this page

Since cPanel version 138.0.28, released on 19 November 2026, the Remote Database Access screen rejects IPv4 addresses written with leading zeros, so an entry like 192.168.001.010 has to be typed as 192.168.1.10. If your app or desktop client lost its MySQL connection around an update, the fix is usually to find the exact public IP the server sees and add it in plain form. You check the result with one login and one query.

Here is the part that surprised me when I read the MySQL manual. MySQL compares the host part of an account as a string, even when it is an IP address, and its own example says a client at 198.51.100.2 does not match an entry written as 198.051.100.2. So a zero-padded entry was never a reliable way to let someone in, and under the new cPanel rule you can no longer type one.

By the end of this guide you will have the right host entry saved in cPanel or WHM, a confirmed login from your client, and a short message you can send to your host or developer if something still fails.

What a remote MySQL host entry actually is

A remote host entry is a line on a list that tells the database server which outside machines may try to log in. Think of a guest list held by the person at a door. The guest still needs the right name and password, but if their address is not on the list, they never get to the password check.

The list is literal. If the list says "Flat 001" and the guest says "Flat 1", a strict doorman turns them away. MySQL behaves the same way: the MySQL 8.4 manual says that, except when you use netmask notation, "the server performs this comparison as a string match, even for an account host value given as an IP address." It also advises you to write host values in the same format DNS uses, which means plain numbers with no padding.

In cPanel this list lives in Remote Database Access. In cPanel and WHM version 118 and earlier the same screen was called Remote MySQL, so older tutorials still use that name.

Why this matters: a host entry that looks right to a human can still fail a string match. Writing the address in its plain, standard form is what makes the match work.

Before you start

Gather these before you touch any settings. It takes about five minutes.

  • A login for cPanel (to add a host for your own account) or WHM (to add a host for every account on the server).
  • The public IP address of the machine that will connect, as the server sees it. Step 1 below shows how to read it from MySQL itself.
  • A copy of the current host list. Open the list and copy every entry and its comment into a text file before you change anything.
  • A test client on the connecting machine, such as the mysql command line client, so you can test without your app in the way.
  • The database user name and password your app uses.
  • A sense of the risk. Adding one exact IP is low risk. Adding a wildcard like % opens the door to every address on the internet and is high risk.

Quick tip: if your list already contains an entry with leading zeros, do not delete it until the corrected entry is saved and tested. That way you can always see what the old entry was meant to be.

Step by step: fix the host entry in cPanel

These steps are for a normal cPanel account owner. You do not need root access.

Step 1: Find the IP the server actually sees

The most reliable source is the MySQL server, because it reports the address it received rather than the one your laptop thinks it has. From the connecting machine, try to log in with the mysql client and read the error.

Run this from the machine that needs access, replacing the host and user with your own values.

mysql -h example.com -P 3306 -u exampleuser_app -p

The -h option names the server, -P sets the TCP port (the manual lists 3306 as the default), -u is the MySQL user, and -p with no value makes the client prompt for the password. If the host is not on the list yet, you will see something like this.

ERROR 1130 (HY000): Host '203.0.113.25' is not allowed to connect to this MySQL server

The address inside the quotes is the one you need. If instead you see an Access denied error, the MySQL manual says that message "tells you who you are trying to log in as, the client host from which you are trying to connect, and whether you were using a password." Read the part after the @ sign for the IP.

Heads up: if you connect from a different network, such as a VPN or a phone hotspot, the server may see a different address. Always read it fresh from the error instead of trusting an old note.

Step 2: Write the address in plain form

Take the address from Step 1 and make sure each of the four numbers has no padding. A few examples make the rule clear.

Rejected since 138.0.28:  192.168.001.010
Write it as:              192.168.1.10

Rejected since 138.0.28:  203.000.113.025
Write it as:              203.0.113.25

Other software draws a similar line. Python's ipaddress module, for example, documents that "Leading zeroes are not tolerated to prevent confusion with octal notation," and it has treated them as an error since Python 3.9.5. That is Python's reason for its own rule. cPanel's changelog does not give a reason for its change, and the only vendor statement is this line from the 138.0.28 notes: "Fixed CPANEL-57183: Reject IPv4 addresses with leading zeros in Remote Database Access."

Step 3: Add the host in cPanel

Open cPanel > Databases > Remote Database Access. The cPanel documentation lists three kinds of value you can type: "You may enter a hostname, IPv4 address, or IPv6 address."

  1. Type the plain address, for example 203.0.113.25, in the Host text box.
  2. Add a short note in the Comment box, such as "Office PC for reports app".
  3. Click Add Host.

You should now see the new address in the list of access hosts, with your comment beside it. If cPanel refuses the value, look again for a stray zero, a space, or a trailing dot.

Step 4: Remove the old padded entry

Once the new entry works (see the checks further down), remove the old one so the list stays honest. Click Delete next to the old host, wait for the confirmation message, then click Remove Access Host. cPanel shows a success message when it is gone.

If a host you removed comes back on its own, or you see one you do not recognise, the cPanel documentation says to contact your hosting provider. Providers can add entries at the server level, which brings us to WHM.

Variant: the server-wide host list in WHM

If you run the server, you can add a host once and have it apply everywhere. Open WHM > Home > Database Services > Manage Database Access Hosts. In version 118 and earlier this screen was called Additional MySQL Access Hosts and sat under SQL Services.

The WHM documentation says "The system applies this list of servers to every cPanel user and every MySQL or MariaDB user that a cPanel user owns." That makes it the right place for a monitoring server or a central app server, and the wrong place for one customer's laptop.

Step 1: Enter the hosts

Type each host in the text box. The docs say you may enter hostnames "as fully qualified domain names (FQDNs) or IP addresses," and they add a firm rule: "You must specify FQDNs in lowercase letters."

Here is how a clean list might look, using one IPv4 address, one IPv6 address and one hostname.

203.0.113.25
2001:db8::10
reports.example.com

Step 2: Save and push to accounts

Click Save. To copy the hosts into each user's access list right away, click the click here link on the same screen. Otherwise users can add the hosts themselves in cPanel.

After saving, open any cPanel account's Remote Database Access page and you should see the new hosts listed there. The WHM docs note that cPanel users cannot permanently remove hosts you add here. If a user deletes one, the system restores it when they open Manage My Databases or when you click click here again.

Variant: a plain MySQL server with no cPanel

If your database runs on its own server without cPanel, there is no host list screen. The host lives inside each account name, written as 'user'@'host'. The MySQL 8.4 manual says "A host value can be a host name or an IP address (IPv4 or IPv6)."

Run this on the database server, as an administrator, to see every account and the host it allows.

SELECT User, Host FROM mysql.user;

Look at the Host column for any value with padded numbers. To see exactly what one account may do, use SHOW GRANTS, which the manual recommends for checking a specific account.

SHOW GRANTS FOR 'exampleuser_app'@'203.0.113.25';

The manual says you should normally manage accounts with statements such as CREATE USER, GRANT and REVOKE rather than editing the grant tables, and it warns that direct INSERT, UPDATE or DELETE on them is "discouraged and done at your own risk." So if you find a padded host, create the account again with the plain host and grant it the same privileges, rather than editing the row by hand.

To allow a small range on a plain MySQL server, the manual documents netmask notation for IPv4 only. A host of 192.0.2.0/255.255.255.0 covers 192.0.2.0 to 192.0.2.255, and netmask notation cannot be used for IPv6 addresses.

A made-up example to tie it together

This scenario is made up for illustration. Sara runs a small shop and uses a desktop reporting tool that reads orders straight from MySQL on her cPanel account. Years ago a freelancer added her office as 203.000.113.025, copying it from a router screen that padded every number.

After her host's server moved to 138.0.28 she tried to tidy the list and could not save the old value again. She ran the mysql test from Step 1, read 203.0.113.25 in the error, added it in plain form, and her tool connected on the next try. Then she deleted the old padded line.

How to check it worked

Run these checks from the machine that needs access. Each one has a clear expected result.

Check 1: Log in again

Repeat the command from Step 1. Expected: a mysql> prompt instead of ERROR 1130. Type exit to leave.

Check 2: Ask the server who it thinks you are

This one line logs in, runs a single query and quits.

mysql -h example.com -P 3306 -u exampleuser_app -p -e "SELECT USER(), CURRENT_USER();"

The -e option runs one statement and quits. According to the MySQL manual, USER() shows the user name you gave and "the client host from which you connected," while CURRENT_USER() shows the account the server matched you to, which decides your privileges.

Expected: the first column ends in @203.0.113.25, and the second ends in the host entry you added, for example @203.0.113.25. If the second column ends in % instead, a wider entry is matching before yours, and you should review the list.

Check 3: Use the real app

Open your app or desktop client and run a normal action, such as loading a report. Expected: data loads with no connection error.

Check 4: Look at the list one last time

In cPanel, reopen Remote Database Access. Expected: only the plain entry is listed, with your comment, and the padded one is gone.

Troubleshooting

Symptom: ERROR 1130 Host is not allowed to connect

The full text in the MySQL error reference is ERROR 1130 (HY000): Host '203.0.113.25' is not allowed to connect to this MySQL server. The MySQL manual explains that it means there is no account row whose host matches the client.

Likely cause: your public IP changed, or the entry still has padding or a typo. Fix: read the IP from the error, add it in plain form, and test again.

Symptom: ERROR 1045 Access denied

The full text is ERROR 1045 (28000): Access denied for user 'exampleuser_app'@'203.0.113.25' (using password: YES). This one means the server let you reach the password check, so the host part of the problem is usually solved.

Likely cause: a wrong password, or a user name that differs from the one in your app's settings. If it says using password: NO, the manual notes you tried to log in without a password at all. Fix: confirm the exact user name and reset the password if needed, then test again.

Symptom: Can't connect to MySQL server

This is client error 2003. The client error reference gives its text as Can't connect to MySQL server on 'example.com:3306' followed by a number in brackets. This happens before any host list is checked.

Likely cause: a firewall blocks port 3306, or MySQL only listens locally. The manual names two server settings that stop remote connections: skip_networking turns off TCP/IP entirely, and bind_address set to 127.0.0.1 accepts only local connections. Fix: on shared hosting, ask your provider whether remote MySQL is allowed at all. On your own server, check the firewall and those two settings.

Symptom: cPanel will not save the address

You type 192.168.001.010 and the Add Host step fails. Likely cause: the 138.0.28 rule that rejects IPv4 addresses with leading zeros. Fix: remove the padding and type 192.168.1.10.

Symptom: ERROR 1129 Host is blocked

The full text is ERROR 1129 (HY000): Host '203.0.113.25' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'. Likely cause: many failed attempts from that address, often an app retrying with old settings. Fix: stop the app, correct its settings, and ask the server administrator to clear the block as the message describes.

Symptom: an entry you deleted keeps coming back

Likely cause: it was added server-wide in WHM. Fix: ask your host to remove it from Manage Database Access Hosts, because cPanel users cannot remove those entries permanently.

Pro tips and security notes

Keep the list short and exact. A wildcard such as % means "any host," and the MySQL manual says use of the % and _ wildcards in host values is deprecated and may be removed in a future version. The cPanel docs still show a partial wildcard example, 192.68.0%, but an exact address is easier to audit.

Do not open port 3306 to the whole internet just to make one client work. If you have SSH access, a tunnel lets your client reach MySQL through an encrypted SSH session instead. The OpenSSH manual documents -L for forwarding a local port to a host and port on the remote side, and -N for "just forwarding ports."

Run this on your own computer to forward local port 3307 to MySQL on the server.

ssh -N -L 3307:127.0.0.1:3306 cpaneluser@example.com

Leave that window open and point your client at your own machine.

mysql -h 127.0.0.1 -P 3307 -u exampleuser_app -p

Because the connection now starts on the server itself, you usually do not need a remote host entry for it. If the tunnel login fails, ask your host whether SSH is enabled for your account.

Also keep cPanel updated. The WHM docs say that, by default, "the system will apply available security updates for your current major version every hour via a cron job." You can see the option in WHM > Server Configuration > Update Preferences as the checkbox "Automatically apply security updates as soon as they are available." At the time of writing (1 December 2026), the latest 138 build is 138.0.30, released on 30 November 2026 with a "Security update for Dovecot." The build before it, 138.0.29, updated Exim to 4.100.2. If you want to confirm your own server's build, our guide to checking whether a cPanel or Plesk VPS is patched walks through it, and the Exim 4.100.2 mail server check covers the 138.0.29 change.

If you also use scripts that call the cPanel API, the 138 series changed something there too. That is a separate fix, covered in our post on cPanel 138, HTTP Basic auth and API token scripts.

The one message worth forwarding

If you cannot reach the host list yourself, send this to your hosting provider or developer. Fill in the two values in brackets.

Hi, our app can no longer connect to MySQL on our cPanel account.
Server: example.com, port 3306, MySQL user: exampleuser_app
The server reports our client IP as: [paste IP from the error, e.g. 203.0.113.25]
Exact error: [paste the full ERROR line]
Since cPanel 138.0.28, Remote Database Access rejects IPv4 addresses with leading zeros.
Please check that our IP is listed in plain form (no padded zeros) in Remote Database Access or WHM Manage Database Access Hosts, and remove any padded duplicate.
If remote MySQL is blocked on this server, please tell us whether an SSH tunnel is allowed instead.
Thanks.

Write the IP exactly the way the server reports it, with no padded zeros, and test with one login before you call it fixed.

Reader questions

Does the leading-zero rule affect IPv6 addresses?

The changelog line for CPANEL-57183 only mentions IPv4 addresses. Remote Database Access still accepts IPv6 addresses such as 2001:db8::10.

Will cPanel delete my old entries that have leading zeros?

The 138.0.28 changelog only says such addresses are rejected and does not say what happens to existing entries. Check your list yourself and replace any padded entry with the plain form.

How long can the comment on a remote host be?

cPanel's documentation says the comment must be 255 ASCII characters or fewer. A short note naming the machine and app is enough.

Can I use a hostname instead of an IP address?

Yes. cPanel accepts a hostname, and WHM accepts fully qualified domain names, which must be typed in lowercase letters.

Which MySQL port should my client use?

The mysql client uses port 3306 by default for TCP connections. Your host may use a different port, so check with them if 3306 does not answer.

Is a percent sign wildcard still safe to use?

It still works, but MySQL 8.4 marks the % and _ wildcards in host values as deprecated. An exact address is safer and easier to review.

Sources & further reading

  1. cPanel 138 change log
  2. cPanel docs: Remote Database Access
  3. WHM docs: Manage Database Access Hosts
  4. WHM docs: Update Preferences
  5. MySQL 8.4: Specifying Account Names
  6. MySQL 8.4: mysql Client Options
  7. MySQL 8.4: Troubleshooting Problems Connecting
  8. MySQL 8.4 Server Error Message Reference
  9. MySQL 8.4: Information Functions
  10. Python docs: ipaddress module

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close