summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-03-16 22:54:25 +0400
committerunknown <vva@eagle.mysql.r18.ru>2004-03-16 22:54:25 +0400
commitdb57be391f2834e9aa63660858618c9ff018c3ec (patch)
treefbc36fc1cbfb8e0701bbca384f81f4f1b7e6a8b8 /client
parente1f771b23e6e87da26ed152e8f49c763c2cf8ecd (diff)
downloadmariadb-git-db57be391f2834e9aa63660858618c9ff018c3ec.tar.gz
roll back change in client/mysqladmin.c for bug
#3160 '"mysqladmin password" doesn't work if --skip-grant-tables' because we can't find out the mysql.user.host properly now mysqladmin just print an advice error-message in this case client/mysqladmin.c: roll back change for bug #3160 '"mysqladmin password" doesn't work if --skip-grant-tables' because we can't find out the mysql.user.host properly now mysqladmin just print an advice error-message in this case
Diffstat (limited to 'client')
-rw-r--r--client/mysqladmin.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index 7fcba3cf803..46bdb896c59 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -795,21 +795,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
else
{
- sprintf(buff,"UPDATE mysql.user SET password='%s' WHERE user='%s' and"
- " host=substring_index(user(),_utf8\"@\",-1)",
- crypted_pw, user);
- if (mysql_query(mysql,buff))
- {
- my_printf_error(0,"unable to update user table; error: '%s'",
- MYF(ME_BELL),mysql_error(mysql));
- return -1;
- }
- if (mysql_query(mysql,"set sql_log_off=0"))
- {
- my_printf_error(0, "Can't turn on logging; error: '%s'",
- MYF(ME_BELL),mysql_error(mysql));
- return -1;
- }
+ /*
+ We don't try to execute 'update mysql.user set..'
+ because we can't perfectly find out the host
+ */
+ my_printf_error(0,"\n"
+ "You cannot use 'password' command as mysqld runs\n"
+ " with grant tables disabled (was started with"
+ " --skip-grant-tables).\n"
+ "Use: \"mysqladmin flush-privileges password '*'\""
+ " instead", MYF(ME_BELL));
+ return -1;
}
}
argc--; argv++;