From 65a6326161c5c4cd119277b47df02cfa85af2f0d Mon Sep 17 00:00:00 2001 From: sepro Date: Mon, 15 May 2017 13:15:42 +0200 Subject: [PATCH] figured out the issue (the database charset), added documentation how to set up DB from mysql CLI --- docs/connect_mysql.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/connect_mysql.md b/docs/connect_mysql.md index 6babdad..8f6c0d6 100644 --- a/docs/connect_mysql.md +++ b/docs/connect_mysql.md @@ -20,4 +20,16 @@ the virtual environment. In the config file the connection needs to be set up using : - SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://user:pass@ip_address/database' \ No newline at end of file + SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://user:pass@ip_address/database' + + +## Setting up the database using the MySQL CLI + +First create a database. The character set and collate are important as sqlalchemy-migrate doesn't work with utf8mb4 (the +default). + + CREATE DATABASE planet_db_01 CHARACTER SET latin1 COLLATE latin1_general_ci; + +Give permissions to a user (planet_dev in this example) to access the database: + + GRANT INDEX, CREATE, DROP, SELECT, UPDATE, DELETE, ALTER, EXECUTE, INSERT on planet_db_01.* TO planet_dev@localhost; \ No newline at end of file