Need help resetting password for MySQL root user

beansbaxter

Verified User
Joined
Mar 17, 2004
Messages
218
Location
WA
Troubleshooting:
Logging into MySQL does not work:
Code:
# mysql -uda_admin -p
Enter password:
ERROR 1045 (28000): Access denied for user 'da_admin'@'localhost' (using password: YES)

Using the instructions here:

Code:
# systemctl stop mysqld
# systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
# systemctl start mysqld
# mysql mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('###########') WHERE user='root'; FLUSH PRIVILEGES;"
ERROR 1348 (HY000) at line 1: Column 'authentication_string' is not updatable

Running MariaDB 10.5.16 on CentOS 7 with the latest version of DA, if it matters.

Any help would be greatly appreciated.
 
Last edited:
There is a difference between user da_admin and root. They have the same rights, but it's 2 different accounts.

So if you want to login as da_admin, then this part of the line should be changed:
WHERE user='root';
to
WHERE user='da_admin';

If authentication_string is not present, then try this:
mysql mysql -e "UPDATE mysql.user SET password=PASSWORD('NEWPASSWORDHERE') WHERE user='da_admin'; FLUSH PRIVILEGES;"
 
Isn't the password in /usr/local/directadmin/conf/mysql.conf

If you change it, be sure to change it in that file too
 
Back
Top