List:General Discussion« Previous MessageNext Message »
From:Shiva Date:December 2 2011 2:43am
Subject:Re: delete syntax
View as plain text  
You can try

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.
Best,
Shiv

On Thu, Dec 1, 2011 at 6:09 PM, Tim Dunphy <bluethundr@stripped> wrote:

> Hello Krishna,
>
>
> 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)
>
>
> sorry for not including enough information last time.
>
> best
> tim
>
> ----- Original Message -----
> From: "Krishna Chandra Prajapati" <prajapatikc@stripped>
> To: "Tim Dunphy" <bluethundr@stripped>
> Cc: mysql@stripped
> Sent: Thursday, December 1, 2011 9:03:46 PM
> Subject: Re: delete syntax
>
> delete from mysql.user where user='mail_admin';
>
> Krishna
>
>
> On Fri, Dec 2, 2011 at 7:23 AM, Tim Dunphy < bluethundr@stripped >
> wrote:
>
>
> hello list,
>
> I am attempting to delete a user from the mysql.user table without success.
>
> mysql> delete from mysql.user where user='mail_admin@%';
> Query OK, 0 rows affected (0.00 sec)
>
>
> mysql> select user,host from mysql.user where user='mail_admin';
> +------------+-----------------------+
> | user | host |
> +------------+-----------------------+
> | mail_admin | % |
>
>
>
> I would appreciate any advice you may have.
>
> Regards,
> Tim
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>
>

Thread
delete syntaxTim Dunphy2 Dec
  • Re: delete syntaxKrishna Chandra Prajapati2 Dec
    • Re: delete syntaxTim Dunphy2 Dec
      • Re: delete syntaxShiva2 Dec
        • Re: delete syntaxReindl Harald2 Dec
          • Re: delete syntaxStdranwl2 Dec
            • Re: delete syntaxReindl Harald2 Dec
              • Re: delete syntaxClaudio Nanni2 Dec
                • Re: delete syntaxReindl Harald2 Dec
                  • Re: delete syntaxGovinda2 Dec
                    • How to get a specific number of entries per one key ?Blog Tieng Viet3 Dec
                      • Re: How to get a specific number of entries per one key ?Arthur Fuller3 Dec
                        • Re: How to get a specific number of entries per one key ?Rik Wasmus5 Dec
    • Re: delete syntaxKeith Keller2 Dec