diff --git a/mysql/create_schema.sql b/mysql/create_schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..5bb97f9c30943f1567af88071eeb56ef34db1f6c --- /dev/null +++ b/mysql/create_schema.sql @@ -0,0 +1,11 @@ +CREATE DATABASE network_latency; + +USE network_latency; + +CREATE TABLE ping_pong ( + id INT AUTO_INCREMENT PRIMARY KEY, + source_ip VARCHAR(20) NOT NULL, + ping_time TIMESTAMP NOT NULL, + pong_time TIMESTAMP NOT NULL, + latency FLOAT NOT NULL +); \ No newline at end of file diff --git a/mysql/provision_scripts/install_mysql.sh b/mysql/provision_scripts/install_mysql.sh index 89a567a4415c768ecd0f6b66fb9f56c0f8c5b7a0..7f19c3b66c33bc2c19126ed9011d8b08d88ae5a9 100644 --- a/mysql/provision_scripts/install_mysql.sh +++ b/mysql/provision_scripts/install_mysql.sh @@ -34,5 +34,8 @@ DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'; FLUSH PRIVILEGES; _EOF_ +echo "Creating database schema" +mysql -u root -pvagrant < /vagrant/create_schema.sql + echo "Finished configuring MySQL"