Unable to Add New Database in CloudPanel VPS - Access denied for user 'root'@'localhost'
0
votes
2
answers
139
views
**Problem**
I'm facing an issue with my VPS running CloudPanel where I cannot add new databases due to MySQL root access being denied.
**Environment**
- CloudPanel on VPS
- MySQL Server
- Hosting Provider: Hostinger
**Error Message**
Access denied for user 'root'@'localhost'
**Steps I've Tried**
**1. Attempted direct MySQL login:**
mysql -u root -p
Result: Access denied error, tried multiple password combinations including:
- Root user password
- Hostinger password
- Default passwords like (12345, admin, root, etc..)
- No password
**2. Attempted MySQL safe mode:**
sudo systemctl stop mysql
sudo mysqld_safe --skip-grant-tables &
Result: Error message:
MySQL cannot start in safe mode because the required directory for the UNIX socket file does not exist.
**3. Attempted to kill running processes:**
sudo kill -9
Result: No process found with specified PID
**4. Created missing directory and set permissions:**
sudo mkdir -p /var/run/mysqld
sudo chown -R mysql:mysql /var/run/mysqld
**5. Restarted MySQL in safe mode and verified process:**
sudo mysqld_safe --skip-grant-tables &
ps aux | grep mysql
Result: Process found running
**6. Attempted passwordless root login:**
mysql -u root
Result: Still encountering access denied error
**Additional Context**
- Hostinger support was unable to resolve the issue
- CloudPanel tutorials show database creation through UI without command-line intervention
- Suspect issue might be related to CloudPanel's default MySQL user restrictions
*I have reached out to Hostinger support, but they were unable to provide a solution beyond what I have already attempted. Additionally, all the YouTube tutorials on setting up and creating a database in CloudPanel show a straightforward process with no access issues, as everything can be done directly from the UI without requiring any command-line input.
I suspect it might be related to CloudPanel’s default MySQL user restrictions or authentication settings, but I’m not sure how to proceed. Has anyone encountered a similar issue or knows how to regain root access?*
Asked by Joe
(1 rep)
Feb 2, 2025, 10:31 AM
Last activity: Aug 5, 2025, 02:10 PM
Last activity: Aug 5, 2025, 02:10 PM