SellYourSaas icon indicating copy to clipboard operation
SellYourSaas copied to clipboard

MariaDB-10.4+ error on "UPDATE mysql.user SET Password=PASSWORD"

Open rycks opened this issue 3 years ago • 4 comments

That is an old mysql command : "UPDATE mysql.user SET Password=PASSWORD" MariaDB-10.4+ the mysql.user is a view rather than a table.

rycks avatar Nov 17 '22 16:11 rycks

So what is instruction to set a password for a user ?

eldy avatar Dec 23 '22 15:12 eldy

Here is an example of the error on remote_server.log

mysql -A -h localhost -P 3306 -usellyoursaas -pxxxxxxx -e 'UPDATE mysql.user SET Password=PASSWORD('\''xxxxxx'\'') WHERE User='\''xxxxxxx'\'';'
ERROR 1356 (HY000) at line 1: View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

rycks avatar Mar 26 '23 08:03 rycks

Yes, i think there is several instruction to set password to be sure to be compatible with all mysql and mariadb version. Error is ignored by the deployer.

eldy avatar Jul 24 '23 19:07 eldy

Hi, I'm running mariadb v10.6 and modified the "action_deploy_undeploy.sh" line

Q3="UPDATE mysql.user SET Password=PASSWORD('$dbpassword') WHERE User='$dbusername'; "

by

Q3="SET PASSWORD FOR '$dbusername' = PASSWORD('$dbpassword'); "
Q3a="SET PASSWORD FOR '$dbusername'@'localhost' = PASSWORD('$dbpassword'); "
Q3b="SET PASSWORD FOR '$dbusername'@'%' = PASSWORD('$dbpassword'); "

and it works perfectly

infocillasas avatar Mar 02 '24 20:03 infocillasas

Change has been merged into official sources.

eldy avatar Apr 13 '24 17:04 eldy