adding maraidb support
This commit is contained in:
+21
-7
@@ -1,7 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# test to create a database from bash
|
||||
mysql << 'EOF'
|
||||
drop DATABASE birds;
|
||||
# This script performs the mysql_secure_installation
|
||||
# Creates the birds database
|
||||
# Creates the detections table
|
||||
# Creates the birder user and grants them appropriate
|
||||
# permissions
|
||||
# If using this script to re-initialize (DROP then CREATE)
|
||||
# the DB, be sure to run this as root or with sudo
|
||||
source /etc/birdnet/birdnet.conf
|
||||
mysql_secure_installation << EOF
|
||||
|
||||
y
|
||||
${DB_ROOT_PWD}
|
||||
${DB_ROOT_PWD}
|
||||
y
|
||||
y
|
||||
y
|
||||
EOF
|
||||
|
||||
mysql << EOF
|
||||
drop database birds;
|
||||
CREATE DATABASE IF NOT EXISTS birds;
|
||||
|
||||
USE birds;
|
||||
@@ -18,11 +35,8 @@ CREATE TABLE IF NOT EXISTS detections (
|
||||
Week INT,
|
||||
Sens FLOAT,
|
||||
Overlap FLOAT);
|
||||
GRANT ALL ON birds.* TO 'birder'@'localhost' IDENTIFIED BY '${DB_PWD}' WITH GRANT OPTION;
|
||||
|
||||
LOAD DATA LOCAL INFILE '/home/pi/Birding-Pi/BirdDB.txt'
|
||||
INTO TABLE detections
|
||||
FIELDS TERMINATED BY ';';
|
||||
SELECT * FROM detections;
|
||||
exit
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user