maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #05925
Re: Set password for all users, regardless of host value
-
To:
Sergei Golubchik <serg@xxxxxxxxxxx>
-
From:
"Chris Ross (cross2)" <cross2@xxxxxxxxx>
-
Date:
Mon, 7 Sep 2020 19:29:04 +0000
-
Accept-language:
en-US
-
Arc-authentication-results:
i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
-
Arc-message-signature:
i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y+WF4Ot4PMLPZymmHF41bUIXSMdp8sV9ipRJBU0B5GU=; b=ASj5RgIggUcOc4Q9zL0fAW1Z1nWC7w6i5cRaGf+N+wEQ5D7v/pQouvNnptyqTD0WOm7WXy9dpGz8vX6fXCkHZXOUXfcs8KO+M9B8NL9tYLukHfKEsyE9FxyoVMi1/pkRTrPhYGOq4rUeNW/eKMYtFnh9Rll8wR+EVAVzVdYZ+MdsyZgX66I218QbdZndNe1Z+sx/dh1Z3u5+RsX3mUMy15FUGfRjMpyuvCGDDjGzA7oFm7WxOG3Hlkfbl2jTrDUmdLKshBSB/ZdPomstEmq0zkpxGi2qSSUyroURSuZgGSnrjyuCPywTFnbvBcxQIwFoL+m6WRzbZejXWMOnsbGokw==
-
Arc-seal:
i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jhLC5IIjHxLkGPBNj6Naj+nijUmT7pfr17ihbFbc1IwOusCky2qZuZsqLHEuPSJNIn0PXe/ykkYarrdB+2wGfCKxpKKS7cL+dBVzH/c8c1A71HYDITmxrtRuHd7x54vTzxR1ccooxKQjli4WsPdeXzexCpiG03uuYvh6F6+QR0iDHVF5lUjk+AKPZFWoBMIy5siBY3U76rfhhdw6qvnMI4K87TQ5qY/06Ie/MyRqVttjaFF1vMAHlSvwAJQS5iKnrCDSYlLYh6SmjnUUWSakM+su08ZbTZztfpu9GIlr9bxCZUuNSKzUXkpfs/Cpfl0q0NRDKzzue36Du4e4bJn2ig==
-
Authentication-results:
mariadb.org; dkim=none (message not signed) header.d=none;mariadb.org; dmarc=none action=none header.from=cisco.com;
-
Cc:
"maria-discuss@xxxxxxxxxxxxxxxxxxx" <maria-discuss@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<20200905083705.GA14332@pweza.fritz.box>
-
Ironport-phdr:
9a23:ZEeU5RN0yxV45ayxeGAl6mtXPHoupqn0MwgJ65Eul7NJdOG58o//OFDEvKw93lrAR4TS5/gCjPDZ4OjsWm0FtJCGtn1KMJlBTAQMhshemQs8SNWEBkv2IL+PDWQ6Ec1OWUUj8yS9Nk5YS8P3fVzbrnf06iQdSV3zMANvLbHzHYjfx828y+G1/cjVZANFzDqwaL9/NlO4twLU48IXmoBlbK02z0jE
-
Thread-index:
AQHWgs7y/e8DbMIXL0enC1oizvXzgqlZudmAgAOXxIA=
-
Thread-topic:
[Maria-discuss] Set password for all users, regardless of host value
-
User-agent:
Microsoft-MacOutlook/16.40.20081000
On 9/5/20, 04:37, "Sergei Golubchik" <serg@xxxxxxxxxxx> wrote:
Hi, Chris!
Yes, you can do an ALTER USER statement, something like
for x in (select host from mysql.global_priv where user='username') do
execute immediate concat('alter user ', 'username', '@`', x.host, '` identified ...and so on' );
end for
Hmm. That is a little ugly. This is of course, in our perl/python/shell scripts, being passed into "mysql -e \"command\"". Making something like that, which is not even syntax I recognize, harder.
you can do an UPDATE too, like
update mysql.global_priv set priv=json_set(priv, 'authentication_string', password(‘rawpassword’))
this is rather fragile and of course not recommended.
This is at least closer to what the old MySQL 5.6 "update mysql.user set password=PASSWORD() where user='val'" looked like. By "fragile and not recommended", for MariaDB 10.5, does that mean it may well stop working in 10.6 or 10.7 ?
But I think what you're doing is somewhat strange. You have multiple
accounts with the same username and different hosts, and you want the
same password for them all? Why do you have multiple accounts in the
first place?
The issue is not as complicated as that. Some users have '%', others have 'localhost'. So most users only have one value for hostspec, but different users have different values, so looping through usernames in a script and running a SQL command for each, puts me here.
Thank you.
- Chris
Follow ups
References