LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-15-2007, 05:03 AM   #1
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
MySQL DROP user --- how to


If I want to delete an account, a user from one of the databases

I login as root by
mysql -u root databasename

This is the user tables
If I DROP USER username from mysql database


Code:
mysql>SELECT host,user,password FROM user ;

+-----------+-----------------+------------
| host      |user             |password   |
-------------------------------------------
|localhost  |root             |
|localhost  |admin            |
|%          |admin@localhost  |xxxxxxxxxxx|
|%          |someone@localhost|xxxxxxxxxxx|
-------------------------------------------

Error would be 
ERROR 1396 (HY000): Operation DROP USER failed for "xxx user"

How can I delete the user (the last two rows)
with host = '%'

Please help
 
Old 08-15-2007, 10:27 AM   #2
GATTACA
Member
 
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 209

Rep: Reputation: 32
First try
Code:
SELECT host,users,password FROM user WHERE host = '%'
if that returns the rows you want to remove do

Code:
DELETE * FROM user WHERE host = '%'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql: how to drop many tables with same prefix? xpucto Linux - Software 3 07-20-2012 09:06 AM
LXer: MySQL to drop Berkeley DB storage engine, add memcache plugin LXer Syndicated Linux News 0 08-31-2006 07:33 AM
Drop connections to port 80 at firewall machine also drop at protected network? Niceman2005 Linux - Security 2 10-27-2005 08:21 AM
mysql drop revoke user from specific host ? RedHat123 Programming 0 04-21-2005 02:54 PM
MYSQL DROP TABLE not working after restoring from backup. leongoogs Linux - Software 0 06-17-2004 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration