[Snort-users] Does any one know how to archive Mysql database?

Kenneth G. Arnold bkarnold at ...8060...
Wed Jan 29 08:25:03 EST 2003


I use a shell script and an sql script to clean our mysql database in 
Solaris.  This also cleans the acid tables.  The script will prompt you for 
the password.

Use your values for username, host,db and mysql location.
The cleanall.sql script needs to be in the same directory as the 
cleanall.shl script.

cleanall.shl
==============================
#!/bin/ksh
username=snort
host=localhost
db=snort
mysql='/usr/local/mysql/bin/mysql'
$mysql -h $host -u $username -p $db < cleanall.sql

cleanall.sql
===================
delete from data;
delete from event;
delete from icmphdr;
delete from iphdr;
delete from opt;
delete from tcphdr;
delete from udphdr;
delete from signature;
delete from sig_class;
delete from sig_reference;
delete from reference;
delete from reference_system;
delete from acid_event;
delete from acid_ip_cache;


Ken Arnold

At 03:27 PM 1/29/03 +0100, =?iso-8859-2?B?U2G5YSBKdblpYw==?= wrote:
>Hi,
>
>I have a similar problem as Antonio.
>
>I found several tools for MySQL database backup, but neither one of them can
>clean the database after it is backuped. I would like to clean the whole
>database after backup, but without deleting any tables.
>
>mysqldump and mysqlhotcopy works very well for database backup, but they
>leave the database intact.
>
>I tried to delete the snort dir inside Mysql data dir, but then I had to
>build the whole database from scratch.
>
>Is there any way to backup the database ad then clear all its contents,
>without deleting all tables in database?
>
>Thanks,
>
>Sasa
>
>-----Original Message-----
>From: snort-users-admin at lists.sourceforge.net
>[mailto:snort-users-admin at lists.sourceforge.net]On Behalf Of Slighter,
>Tim
>Sent: Tuesday, January 28, 2003 4:58 PM
>To: 'Deyoung, Richard E. - Raleigh, NC'; ANTONIO GUTIERREZ;
>snort-users at lists.sourceforge.net
>Subject: RE: [Snort-users] Does any one know how to archive Mysql
>database?
>
>
>mysqldump dbname -u "user" -p > /tmp/28Jan2003.dbname.sql
>
>-----Original Message-----
>From: Deyoung, Richard E. - Raleigh, NC [mailto:RDeyoung at ...8118...]
>Sent: Tuesday, January 28, 2003 8:20 AM
>To: ANTONIO GUTIERREZ; snort-users at lists.sourceforge.net
>Subject: RE: [Snort-users] Does any one know how to archive Mysql
>database?
>
>
>Antonio,
>You may want to look at the 'mysqlhotcopy' command. You'll have to
>supply the database password, the name of the database you're backing
>up, and a target location (as in a directory name) where the backup will
>be stored.
>
>HTH,
>Richard DeYoung
>Email:   RDeYoung at ...8118...
>
>________________________________________________________________________
>|Notice: This e-mail message, including any attachments, is
>|for the sole use of the intended recipients and may contain sensitive
>|and privileged information. Any unauthorized review, use, disclosure
>|or distribution is prohibited. If you are not the intended recipient,
>|please contact the sender by reply e-mail and destroy all copies of
>|the original message.
>|_______________________________________________________________________
>
>-----Original Message-----
>From: ANTONIO GUTIERREZ [mailto:ANTONIO.GUTIERREZ at ...7780...]
>Sent: Tuesday, January 28, 2003 9:36 AM
>To: snort-users at lists.sourceforge.net
>Subject: [Snort-users] Does any one know how to archive Mysql database?
>
>Does any one  know how to archive Mysql database?
>
>Antonio Gutierrez
>Gutierra at ...7781...
>System Support specialist.
>13000 Wm. Dodson Plwiy
>Farmers Branch, TX 75234
>972-9192565
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
>http://www.vasoftware.com
>_______________________________________________
>Snort-users mailing list
>Snort-users at lists.sourceforge.net
>Go to this URL to change user options or unsubscribe:
>https://lists.sourceforge.net/lists/listinfo/snort-users
>Snort-users list archive:
>http://www.geocrawler.com/redir-sf.php3?list=snort-users
>
>
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
>http://www.vasoftware.com
>_______________________________________________
>Snort-users mailing list
>Snort-users at lists.sourceforge.net
>Go to this URL to change user options or unsubscribe:
>https://lists.sourceforge.net/lists/listinfo/snort-users
>Snort-users list archive:
>http://www.geocrawler.com/redir-sf.php3?list=snort-users
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
>http://www.vasoftware.com
>_______________________________________________
>Snort-users mailing list
>Snort-users at lists.sourceforge.net
>Go to this URL to change user options or unsubscribe:
>https://lists.sourceforge.net/lists/listinfo/snort-users
>Snort-users list archive:
>http://www.geocrawler.com/redir-sf.php3?list=snort-users
>
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
>http://www.vasoftware.com
>_______________________________________________
>Snort-users mailing list
>Snort-users at lists.sourceforge.net
>Go to this URL to change user options or unsubscribe:
>https://lists.sourceforge.net/lists/listinfo/snort-users
>Snort-users list archive:
>http://www.geocrawler.com/redir-sf.php3?list=snort-users





More information about the Snort-users mailing list