wok diff mysql/stuff/reset-password.sh @ rev 24729
updated libdnet and libdnet-dev (1.12 -> 1.14)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Mar 15 16:28:57 2022 +0100 (2022-03-15) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mysql/stuff/reset-password.sh Tue Mar 15 16:28:57 2022 +0100 1.3 @@ -0,0 +1,12 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +[ -z "$1" ] && echo "Usage: $0 <newpassword>" && exit 1 1.7 + 1.8 +/etc/init.d/mysql stop 1.9 +/usr/bin/mysqld_safe --skip-grant-tables & 1.10 +mysql <<EOT 1.11 +UPDATE `mysql`.`user` SET `Password` = password('$1') WHERE `User` = "root" AND Host = "localhost"; 1.12 +quit 1.13 +EOT 1.14 +mysqladmin shutdown 1.15 +/etc/init.d/mysql start