From: Reindl Harald Date: December 2 2011 5:03am Subject: Re: delete syntax List-Archive: http://lists.mysql.com/mysql/226427 Message-Id: <4ED85C27.9040003@thelounge.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig709D10F0532A98EFD02CA79E" --------------enig709D10F0532A98EFD02CA79E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable well, i am using delete/insert-statements since 10 years to maintain users since you only have to know the tables in the database "mysql" and use "flush privileges" after changes DROP USER is the only SINGLE COMMAND as long as you do not use table/column-privileges there are exactly two relevant tables: "user" and "db" Am 02.12.2011 05:15, schrieb Stdranwl: > DROP USER command is the only command to remove any user and its > association from all other tables..... >=20 > On Fri, Dec 2, 2011 at 8:22 AM, Reindl Harald w= rote: >=20 >> ALWAYS >> start with "select * from mysql.user where user=3D'mail_admin' and hos= t like >> '\%';" >> and look what records are affected to make sure the were-statement wor= ks 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 lo= gical >> mistakes like forget a "and column=3D1" and get "1000 rows affected" w= ith no >> way back --------------enig709D10F0532A98EFD02CA79E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7YXCcACgkQhmBjz394AnltFQCfVgPRDzQVWoxzhX48t9vFOQo8 lhIAnRjVAv2jeMTbyMMw6RepCGnFboet =HcRB -----END PGP SIGNATURE----- --------------enig709D10F0532A98EFD02CA79E--