5
I installed MySQL 5.5 on a fresh VM running Ubuntu 14 LTS through apt-get
. During installation, I set a root user password generated by a password manager. After installation, I could not access any functions as the MySQL root user:
<user>@<hostname>:~$ mysql -u root -p
Enter password: <root user pw set at installation>
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Thinking something went wrong setting the root password, I used
<user>@<hostname>:~$ sudo dpkg-reconfigure mysql-server-5.5
to reset the root password, though I "reset" it to the exact same password. I continued to receive the same Access denied
error.
I then reset the root password again, using the same method, to something shorter and easily typable (i.e., weak), using only alphanumeric characters. This worked! I can now access MySQL functions as the root user.
It seems like the only difference is the complexity of the password. The original strong password was 18 characters and included punctuation symbols like ^ \ : !, etc. Only ASCII, though, and no whitespaces.
Did this password violate some sort of rule that MySQL passwords must follow, either in terms of length or character sets? I've searched, and I haven't found any references to such restrictions, which I'd think would be well-publicized. If not this, then what else could the problem have been?
Thanks!
You might simply try to access the MySQL instance from
127.0.0.1
instead with a syntax such as..............mysql -u root -p -h 127.0.0.1
and then see what happens. Perhaps thelocalhost
is not allowed per--skip-name-resolve
being set or just having an explicit rule to only allow root to connect from the127.0.0.1
host. – Pimp Juice IT – 2018-10-16T14:56:32.937