- 论坛徽章:
- 0
|
snort question?
Setting up the database in MySQL:
I will put a line with a >; in front of it so you will see what the output should be. (Note: In
MySQL, a semi-colon ” ; “character is mandatory at the end of each input line)
(new_password is whatever password you want to give)
/usr/local/mysql/bin/mysql
mysql>; SET PASSWORD FOR root@localhost=PASSWORD('new_password');
>;Query OK, 0 rows affected (0.25 sec)
mysql>; create database snort;
>;Query OK, 1 row affected (0.01 sec)
mysql>; grant INSERT,SELECT on root.* to snort@localhost;
>;Query OK, 0 rows affected (0.02 sec)
mysql>; SET PASSWORD FOR snort@localhost=PASSWORD('new_password');
>;Query OK, 0 rows affected (0.25 sec)
mysql>; grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort@localhost;
>;Query OK, 0 rows affected (0.02 sec)
mysql>; grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort;
>;Query OK, 0 rows affected (0.02 sec)
mysql>; exit
>;Bye
From the Snort 2.1.0 source directory (/root/snortinstall/snort-2.1.0) execute the
following command (when working with MySQL, if it asks for a password it is wanting
the one you defined in the SQL statement “SET PASSWORD FOR
root@localhost=PASSWORD('new_password');”)
/usr/local/mysql/bin/mysql -u root -p < ./contrib/create_mysql snort
Version 6.1 Page 16 of 23 Updated 2/14/2004 1:21 AM
Enter password:
Then install the extra DB tables using the following command from the contrib directory
(you will need to cd to contrib)
zcat snortdb-extra.gz |/usr/local/mysql/bin/mysql -p snort
Enter password:
Now you need to check and make sure that the snort DB was created correctly
/usr/local/mysql/bin/mysql -p
>;Enter password:
mysql>; SHOW DATABASES;
(You should see the following)
+------------+
| Database
+------------+
| mysql
| snort
| test
+------------+
3 rows in set (0.00 sec)
mysql>; use snort
>;Database changed
mysql>; SHOW TABLES;
+------------------+
| Tables_in_snort
+------------------+
| data
| detail
| encoding
| event
| flags
| icmphdr
| iphdr
| opt
| protocols
| reference
| reference_system
| schema
| sensor
| services
| sig_class
| sig_reference
| signature
| tcphdr
Version 6.1 Page 17 of 23 Updated 2/14/2004 1:21 AM
| udphdr
+------------------+
19 rows in set (0.00 sec)>;
exit |
|