List:General Discussion« Previous MessageNext Message »
From:Tim Dunphy Date:January 14 2012 11:23pm
Subject:delete all hosts using a wildcard
View as plain text  
hello list,

 I have a number of hosts that I would like to delete using a wildcard (%) symbol. 

  Here is the query I am using:
  
  mysql> delete from mysql.user where user='%.summitnjhome.com';
Query OK, 0 rows affected (0.00 sec)

 And I am attempting to delete all the hosts at the domain 'summitnjhome.com'...

 But as you can see I am unsuccessful:

 mysql> select user,host from mysql.user;
+----------+-----------------------------+
| user     | host                        |
+----------+-----------------------------+
| root     | 127.0.0.1                   |
| repl     | virtcent10.summitnjhome.com |
| admin    | virtcent11.summitnjhome.com |
| repl     | virtcent19.summitnjhome.com |
| repl     | virtcent23.summitnjhome.com |
| repl     | virtcent30.summitnjhome.com |
+----------+-----------------------------+


I know I can delete them individually and this is what I am going to do. But I would like
to use this as a learning opportunity to help me understand how the wildcard works. 

Thanks in advance..

Best regards,
Tim

 
Thread
delete all hosts using a wildcardTim Dunphy14 Jan
  • Re: delete all hosts using a wildcardPaul DuBois14 Jan
    • Re: delete all hosts using a wildcardTim Dunphy15 Jan
      • Re: delete all hosts using a wildcardClaudio Nanni16 Jan
Re: delete all hosts using a wildcardJan Steinman16 Jan
  • Re: delete all hosts using a wildcardGovinda16 Jan