wok diff mysql/stuff/reset-password.sh @ rev 23806
linld: add isoboot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 24 16:16:52 2020 +0000 (2020-05-24) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mysql/stuff/reset-password.sh Sun May 24 16:16:52 2020 +0000 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