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.
📋 Table of Contents
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
- 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
- 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.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Pc crashes shortly after launching game, possible cause: outdated grap
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: FPS drops
FPS drops in games can be caused by high system resource usage, outdat