Software⏱️ 2 min read📅 2026-05-31

How to Fix ERROR 1045 Error – Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user

Enable remote MySQL connection to allow secure access from remote machines.

Quick Answer: Grant necessary privileges and configure MySQL server settings to enable remote connections.

To resolve the 'Access denied for user' error when trying to connect to MySQL remotely, you need to ensure that the remote machine can access the MySQL server and its root user. The issue lies in the fact that MySQL is not configured to allow remote connections by default.

✅ Best Solutions to Fix It

Method 1: Allow Remote Connections via TCP Port 3306

  1. Step 1: Open the MySQL configuration file (my.cnf or my.ini) using a text editor and add the following line to the [mysqld] section: skip-networking = 0

Method 2: Create a New User with Remote Access Privileges

  1. Step 1: Create a new user on the remote machine using the MySQL command-line tool or a GUI client, and grant it the 'REMEMOTE' privilege. For example: mysql -h 192.168.233.142 -u newuser -pnewpassword

🎯 Final Words

After applying these solutions, restart the MySQL service on the remote machine and attempt to connect again using the remote machine. If you continue to encounter issues, verify that the MySQL server is listening on TCP port 3306 and that the remote machine can resolve the hostname correctly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions