LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-06-2009, 10:44 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Removing Old Table Data From MySQL


When a user logs into my webmail application, it creates entries in a table on MySQL called "identities" which works great however once the user is deleted fro Linux with the "userdel -r" command, the data still sits in MySQL. My question is how I can I remove the table data from old users?

It appears as show below:

Code:
mysql> select * from identities;
+-------------+-----+----------+-----------------+--------------+-----------------------+----------+-----+------------+----------------+---------+
| identity_id | del | standard | name            | organization | email                 | reply-to | bcc | signature  | html_signature | user_id |
+-------------+-----+----------+-----------------+--------------+-----------------------+----------+-----+------------+----------------+---------+
|           1 |   0 |        1 | Jasson Williams |              | jasson@iamorlando.com |          |     |      |     |              0 |       1 | 
|           2 |   0 |        1 | carlos          |              | carlos@iamorlando.com |          |     |            |              0 |       2 | 
|           3 |   0 |        1 | Carlos Williams |              | carlos@iamdead.com    |          |      |          |              0 |       3 | 
+-------------+-----+----------+-----------------+--------------+-----------------------+----------+-----+------------+----------------+---------+
3 rows in set (0.00 sec)
 
Old 07-06-2009, 11:01 AM   #2
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
DELETE FROM identities WHERE ...;

I don't know what the WHERE clause is, because I don't know how to identify 'old' users.
If you do it by hand, though, you can use 'WHERE identity_id = 1;' and so on...

Or, you could download MySQLAdmin and use that...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
help with mysql command to update data in a table ncsuapex Programming 2 09-30-2008 12:32 PM
mysql - data validation at the table-creation-time prabhatsoni Linux - Software 2 03-24-2006 01:13 AM
Problem inserting data into a mysql table using PHP Rockgod2099 Programming 13 08-03-2005 01:27 AM
why do i get this error when inserting data to a mysql table verbatim Programming 2 06-15-2005 07:12 AM
mysql - transfer data from one table to another?? macinslaw Programming 22 08-20-2004 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:38 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