add sql files to create and remove the database
This commit is contained in:
parent
bd2ddf1260
commit
9bf2f2282b
|
@ -31,10 +31,9 @@ Vagrant.configure("2") do |config|
|
|||
libnss-mdns libapache2-mod-wsgi-py3 python3-mysqldb
|
||||
|
||||
|
||||
#So würde der Code aussehen um SQL Scripts in die DB zu importieren.
|
||||
#mysql < /vagrant/sql/remove_db.sql
|
||||
#mysql < /vagrant/sql/create_db.sql
|
||||
#mysql < /vagrant/sql/add_data.sql
|
||||
#initialize the db
|
||||
mysql < /vagrant/sql/04_remove_database.sql
|
||||
mysql < /vagrant/sql/01_create_database.sql
|
||||
|
||||
#löschen und verlinken der HTML root damit man diese nicht manuel kopieren muss.
|
||||
if ! [ -L /var/www/html ]; then
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
-- Creates the webshop DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- 2017-11-04
|
||||
-- MariaDB 10.1.26
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
create database if not exists webshopdb;
|
||||
grant all on webshopdb.* to
|
||||
'webshop'@'localhost'
|
||||
identified by '2YKtY53F3HDDzPyExAaSh3jdVNh6VN';
|
||||
flush privileges;
|
|
@ -0,0 +1,8 @@
|
|||
-- Removes the webshop DB
|
||||
--
|
||||
-- Author: Andreas Zweili
|
||||
-- 2017-11-04
|
||||
-- MariaDB 10.1.26
|
||||
|
||||
drop database if exists webshopdb;
|
||||
drop user if exists webshop@localhost;
|
Loading…
Reference in New Issue