ALWAYS
start with "select * from mysql.user where user='mail_admin' and host like 
'\%';"
and look what records are affected to make sure the were-statement works as
expected and then use "CURSOR UP" and edit the last command to "delete from"

not only doing this while unsure with escapes  protects you against logical
mistakes like forget a "and column=1" and get "1000 rows affected" with no
way back

Am 02.12.2011 03:43, schrieb Shiva:
> delete from mysql.user where user='mail_admin' and host like '\%' ;
> Note: I haven't tested it and since % is a wildcard you need to escape it.
> 
> On Thu, Dec 1, 2011 at 6:09 PM, Tim Dunphy <bluethu...@jokefire.com> wrote:
> 
>>
>> Thanks but I probably should have noted that I only want to delete the
>> wildcard user. There are other users I would prefer to not delete.
>>
>> mysql> select user,host from mysql.user where user='mail_admin';
>> +------------+-----------------------+
>> | user       | host                  |
>> +------------+-----------------------+
>> | mail_admin | %                     |
>> | mail_admin | 127.0.0.1             |
>> | mail_admin | localhost             |
>> | mail_admin | localhost.localdomain |
>> +------------+-----------------------+
>> 4 rows in set (0.00 sec)

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to