snort/snort-createmysql

12 lines
461 B
Plaintext
Raw Normal View History

#!/bin/bash
mysqladmin create snort
cat << EOF | mysql -u root snort
grant INSERT,SELECT on root.* to snort@localhost;
SET PASSWORD FOR snort@localhost=PASSWORD('$1');
grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort@localhost;
grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort;
exit
EOF
mysql -u root < /usr/share/snort/contrib/create_mysql snort
bzcat /usr/share/snort/contrib/snortdb-extra.bz2 | mysql -u snort --password="$1" snort