From: Stephen Finucane Date: Wed, 10 Feb 2016 19:41:55 +0000 (+0000) Subject: docs: Combine MySQL init/reinit instructions X-Git-Tag: v1.1.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef2df3fb71488a8429e09981807612a09c96e55f;p=thirdparty%2Fpatchwork.git docs: Combine MySQL init/reinit instructions Apply some learnings for the Vagrant work and combine the commands used to configure a MySQL database for first time use with those used to reset an existing database. This should simplify installation. Signed-off-by: Stephen Finucane --- diff --git a/docs/development.md b/docs/development.md index 8b46969c..54b65e79 100644 --- a/docs/development.md +++ b/docs/development.md @@ -137,21 +137,14 @@ To begin, export your database credentials as follows: Now, create the database. If this is your first time configuring the database, you must create a `patchwork` user (or similar) along with the database -instance itself. You can do this like so: +instance itself. The commands below will do this, dropping existing databases +if necessary: (.venv)$ mysql -u$db_user -p$db_pass << EOF + DROP DATABASE IF EXISTS patchwork; CREATE DATABASE patchwork CHARACTER SET utf8; - CREATE USER 'patchwork'@'localhost' IDENTIFIED BY 'password'; - GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost'; - EOF - -If you're resetting your database instead, then you must drop the existing -database and recreate it. You can do this like so: - - (.venv)$ mysql -u$db_user -p$db_pass << EOF - DROP DATABASE patchwork; - CREATE DATABASE patchwork CHARACTER SET utf8; - GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost'; + GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost' + IDENTIFIED BY 'password'; EOF **NOTE:** The `patchwork` username and `password` password are the defaults