Create the Database

Before we can actually setup and run our new app, it needs a database.

This must be created via normal RDBMS tools; Wutta Framework does not (yet?) provide any tooling for this step.

PostgreSQL is recommended although MariaDB/MySQL is also supported.

PostgreSQL

Install APT packages if needed:

sudo apt install postgresql libpq-dev

Install Python packages (to virtual environment) if needed:

pip install psycopg

Make a new DB user (myuser) if needed:

sudo -u postgres createuser myuser

And if so, also set the password:

sudo -u postgres psql -c "ALTER USER myuser PASSWORD 'mypassword'"

And finally create the DB (poserdb owned by myuser):

sudo -u postgres createdb -O myuser poserdb

MariaDB/MySQL

Install APT packages if needed:

sudo apt install default-mysql-server

Install Python packages (to virtual environment) if needed:

pip install mysql-connector-python

Make a new DB user (myuser) if needed:

sudo mysql -e "CREATE USER myuser@localhost"

And if so, also set the password:

sudo mysql -e "ALTER USER myuser@localhost  IDENTIFIED BY 'mypassword'"

Create the DB (poserdb):

sudo mysqladmin create poserdb

And grant all perms (to myuser for poserdb):

sudo mysql -e "GRANT ALL ON poserdb.* TO myuser@localhost"