Mysql change password root Column Password is not updatable

castris

Verified User
Joined
Apr 16, 2021
Messages
22
Location
Arcenillas
Hi

In fresh server.

Directadmin Doc:: Mariadb Mysql Troubleshooting

Teh doc fails almsot in MariabDb Server version: 10.6.18-MariaDB MariaDB Server

Bash:
root@srv120:~# mysqld_safe --skip-grant-tables &

[1] 3366

root@srv120:~# 240702 21:54:19 mysqld_safe Logging to '/usr/local/mysql/data/srv120.err'.

240702 21:54:19 mysqld_safe Starting mariadbd daemon with databases from /usr/local/mysql/data


root@srv120:~# mysql mysql -e "UPDATE mysql.user SET password=PASSWORD('27#i3TCRZ3@yFq') WHERE user='root'; FLUSH PRIVILEGES;"

ERROR 1348 (HY000) at line 1: Column 'Password' is not updatable

root@srv120:~# ps aux| grep mysql

mysql       3334  0.1  0.1 1342524 82880 ?       Ssl  21:54   0:00 /usr/local/mysql/bin/mysqld --skip-grant-tables --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock

root        3469  0.0  0.0   6480  2128 pts/0    S+   21:55   0:00 grep --color=auto mysql
 
Teh doc fails almsot in MariabDb Server version: 10.6.18-MariaDB MariaDB Server
Seems docs are using an older method, should be a bit different if I'm correct.

Changing root pass:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password_here';

or according to MariaDB documentation:
  • restart MariaDB with --skip-grant-tables
  • login into the unprotected server
  • run FLUSH PRIVILEGES (note, before 10.4 this would’ve been the last step, not anymore). This disables --skip-grant-tables and allows you to change the stored authentication method
  • run SET PASSWORD FOR root@localhost to change the root password.
which would be (if I understood correctly):
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
 
It's a fresh install you say.
If you don't know the password, you can find it in the following files:
/usr/local/directadmin/scripts/setup.txt
/usr/local/directadmin/conf/my.cnf
/usr/local/directadmin/conf/mysql.conf
 
Back
Top