From 07d8d01c9236ecfd8638b831ab6c0878ddb7141a Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Tue, 2 Jan 2018 14:31:12 +0100 Subject: [PATCH 1/3] Update database.sql This makes an installation way easier --- database.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database.sql b/database.sql index 79dc9f7..43f2c70 100644 --- a/database.sql +++ b/database.sql @@ -1,3 +1,10 @@ +-- make sure it exists +create database if not exists mar; + +-- switch to use it +use mar; + +-- create tables create table mar_user ( username varchar(20) not null From 0e15797645f2391258373000ace8770e53d392bc Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Tue, 2 Jan 2018 14:49:09 +0100 Subject: [PATCH 2/3] Update database.sql Added auto user - TODO: make this based on some root level config file? --- database.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index 43f2c70..2160a61 100644 --- a/database.sql +++ b/database.sql @@ -1,7 +1,11 @@ -- make sure it exists create database if not exists mar; --- switch to use it +-- create user (will be created if not exists) and grant privileges +grant all privileges on `mar`.* to `mar`@`localhost` identified by 'mar'; +flush privileges; + +-- switch to use the database use mar; -- create tables From b5a9a13b99cbed54188073071e87630267d1cb86 Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Tue, 2 Jan 2018 14:52:13 +0100 Subject: [PATCH 3/3] Update README.md See way easier --- README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 070a55b..557c8c0 100644 --- a/README.md +++ b/README.md @@ -7,22 +7,12 @@ Easiest way to configure the database: ```bash $ pwd ~/Much-Assembly-Required-Frontend/ -$ mysql -u root -p -Enter password: # type your MySQL root user password - -MariaDB [(none)]> -MariaDB [(none)]> CREATE DATABASE mar; -MariaDB [(none)]> GRANT ALL PRIVILEGES ON mar.* to 'mar'@'localhost' identified by 'mar'; -MariaDB [(none)]> FLUSH PRIVILEGES; -MariaDB [(none)]> USE mar; -MariaDB [mar]> \. database.sql -MariaDB [(none)]> exit -Bye -$ # if '\. database.sql' failed you were not in the right directory. make sure you are in the repo root directory -$ # before running these commands +$ mysql -u root -p < database.sql +Enter password: # type your MySQL root user password if you set any + # on a fresh install the password is empty + # NOTE: on a fresh install you might have to run the command with sudo + # NEVER blindly run commands as sudo. Check the contents of the 'database.sql' file first! ``` -Make sure to change the configuration in /include/config.php. -> Tough if you used the snippet above there is nothing to change (except the title if you want) More information about the game [here.](https://github.com/simon987/Much-Assembly-Required) HTML template by ajlkn