SOLVED Access denied for user

Operating System & Version
CentOS Linux 7
cPanel & WHM Version
92.0 (build 9)

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Hello,

Using: cPanel / WHM 92.0 (build 9)
Error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Purpose: attempting to import large DB (not an option to use phpMyAdmin).

I've added a new database and user via the cPanel account page (MySQL Databases). I can access phpMyAdmin without issue. But I am unable to access the DB via SSH using mysql -u root -p. The same goes for if I try to mysql -u new_account_made_with_cpanel -p. The error is the same (as above).

I've tried going in to phpMyAdmin via cPanel > phpMyAdmin (meaning, not at account level but main dashboard where I can see all of my accounts). I then flush privileges, no change. I also did 'DELETE FROM mysql.user WHERE User='';', no change.

I'm not very experienced and unsure what to do to debug further. Any guidance is greatly appreciated.

Thank you
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,399
2,255
363
cPanel Access Level
Root Administrator
Hey there! It seems like access for the root user may be broken on that system, as I would expect root to have full access to MySQL and all the tools on the machine.

Can you try to fix this through our automated tool in WHM >> MySQL Root Password? This will attempt a reset of the MySQL root user password on the system, and may be enough to get that resolved for you.
 
  • Like
Reactions: 4pples

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Hey there! It seems like access for the root user may be broken on that system, as I would expect root to have full access to MySQL and all the tools on the machine.

Can you try to fix this through our automated tool in WHM >> MySQL Root Password? This will attempt a reset of the MySQL root user password on the system, and may be enough to get that resolved for you.
Hi @cPRex, thank you kindly for the reply. I have tried, a couple of times (via WHM), but it makes no impac whatsover - same error.
 

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Seems I found the issue - password. I don't mean I had the wrong password, but rather, either the password length I had (99 chars) or some character(s) in the password that was randomly generated by my password storage program was accepted by cPanel but then borked by mysql cli. Once I clipped it down to 75 it worked. I didn't do any testing beyond this to determine whether it was an issue with length or "bad" characters.

Thank you for your time and help