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 <bluethundr@stripped> 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: [application/pgp-signature] OpenPGP digital signature signature.asc

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.