• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error 1130 – SQLSTATE: HY000 (ER_HOST_NOT_PRIVILEGED) Host ‘%s’ is not allowed to connect to this MySQL server

December 20, 2023

How to Fix MySQL Error 1130 – SQLSTATE: HY000 (ER_HOST_NOT_PRIVILEGED) Host ‘%s’ is not allowed to connect to this MySQL server

MySQL is a popular open-source relational database management system used by many websites and applications. However, sometimes users may encounter an error message that says “Error 1130 – SQLSTATE: HY000 (ER_HOST_NOT_PRIVILEGED) Host ‘%s’ is not allowed to connect to this MySQL server.” This error occurs when the MySQL server denies access to a specific host attempting to connect to it. In this article, we will explore the possible causes of this error and provide solutions to fix it.

Possible Causes of MySQL Error 1130

There are several reasons why you might encounter MySQL Error 1130:

  1. Incorrect MySQL user privileges: The user account you are using to connect to the MySQL server may not have the necessary privileges to access it.
  2. Incorrect MySQL host: The host you are trying to connect from may not be allowed to access the MySQL server.
  3. Firewall or network configuration: A firewall or network configuration may be blocking the connection between the host and the MySQL server.

Fixing MySQL Error 1130

Here are some solutions to fix MySQL Error 1130:

1. Check MySQL User Privileges

Ensure that the user account you are using to connect to the MySQL server has the necessary privileges. You can do this by logging in to the MySQL server as an administrator and running the following command:

GRANT ALL PRIVILEGES ON *.* TO 'username'@'host' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Replace ‘username’, ‘host’, and ‘password’ with the appropriate values. This command grants all privileges to the specified user from the specified host.

2. Check MySQL Host Access

Verify that the host you are trying to connect from is allowed to access the MySQL server. You can do this by running the following command on the MySQL server:

SELECT user, host FROM mysql.user;

This command will display a list of users and their corresponding hosts. Ensure that there is an entry for the user and host you are trying to connect from. If not, you can add it using the following command:

CREATE USER 'username'@'host' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'host';
FLUSH PRIVILEGES;

Replace ‘username’, ‘host’, and ‘password’ with the appropriate values.

3. Check Firewall and Network Configuration

If you have a firewall or network configuration in place, ensure that it allows the connection between the host and the MySQL server. Check if any firewall rules or network settings are blocking the connection. You may need to consult your network administrator or hosting provider for assistance in configuring the firewall or network settings.

Summary

In conclusion, MySQL Error 1130 – SQLSTATE: HY000 (ER_HOST_NOT_PRIVILEGED) Host ‘%s’ is not allowed to connect to this MySQL server can be caused by incorrect user privileges, incorrect host access, or firewall/network configuration issues. To fix this error, you can check and adjust the MySQL user privileges, verify the MySQL host access, and ensure that the firewall or network configuration allows the connection. For reliable and high-performance VPS hosting solutions, consider Server.HK. Our Hong Kong VPS hosting services provide the resources and flexibility you need to run your applications smoothly.

Recent Posts

  • Hong Kong VPS Security Checklist: 10 Steps to Harden Your Server in 2026
  • NVMe SSD vs SATA SSD for VPS Hosting: Does Storage Type Really Matter?
  • Hong Kong VPS Docker Setup: Run Containers with Full Root Access
  • How to Set Up a Game Server on Hong Kong VPS: Low-Latency Gaming for Asia
  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide

Recent Comments

  1. hello world on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot