SHOW GRANTS FOR 'your
user'@'your
host';
Replace `youruser` and `yourhost` with the actual username and host you're connecting from. This will show you the permissions the user has and whether it includes access to the desired database.
GRANT ALL ON your
database.* TO 'your
user'@'your_host';
Replace `yourdatabase`, `youruser`, and `your_host` with the actual database name and user details. This grants full permissions to the user for the specified database.
FLUSH PRIVILEGES;
SHOW DATABASES;
systemctl status mysql
sudo systemctl restart mysql
sudo tail -f /var/log/mysql/error.log
Following these steps should help identify the root cause of the "1044: Access denied for user to database" error and allow you to take corrective action.
Let Dr. Droid create custom investigation plans for your infrastructure.
Start Free POC (15-min setup) →