We did this:
"sudo su - postgres
psql
CREATE USER mastodon CREATEDB;
\q
"
But there's no password?
@ashkitten it didn't tell us to do that.
It just said run the code so we ran the code. We are babby sysadmin
@spiderrobotpig You need to configure everything in the .env.production :)
@spiderrobotpig We can also help you administrate your instance if you like :)
@ashkitten That actually sounds super useful tbh.
Also how would we even do that?
sudo -u postgres psql -c "UPDATE USER mastodon WITH password 'the-password-you-want';"
@asonix We found that, but we can't seem to log into postgres as mastodon?
Like it just ends up being postgres@spiderrobotpig@computername with an unknown password
Bleh we are bad at this.
But now we gotta do it tbh
log in how? with psql?
@asonix We dunno.
Like, once we make the mastodon user, it just does it, then leaves us with the user postgres@spiderrobotpig@{computername} and it's borked
creating the user doesn't automatically log you in as that user.
if you want to log into postgres as the mastodon user with psql, you would do
sudo -u postgres psql -U mastodon
@asonix It said peer authentication failed when we tried that
from http://stackoverflow.com/questions/17443379/psql-fatal-peer-authentication-failed-for-user-dev
sudo -u postgres psql -U mastodon -h 127.0.0.1
@asonix Now it says the database doesn't exist.
Gonna go cry in a corner for a bit now haha
The database was never created. the "mastodon" user was created with permissions to create a database.
If you're using "-d mastodon" in your command, it will not work until you first create a database with the mastodon user as the owner.
@asonix we did CREATE USER mastodon CREATE DATABASE;
\q
Was that wrong?
@asonix CREATEDB**
That creates the mastodon user with CREATEDB permissions, but does not create a database
sudo -u postgres psql
CREATE DATABASE mastodon WITH OWNER mastodon;
\q
@asonix YAAAAAAAAAAAAAAAAAY
THANK YOU >^<
@spiderrobotpig wait, its probably "ALTER" not "UPDATE"
@spiderrobotpig Did you configure the db user at the top of your .env.production?