Open yw-fang opened 6 years ago
/etc/init.d/postgresql restart # Ref: https://stackoverflow.com/questions/34918025/how-to-restart-postgresql This is used for restarting the service of postgresql
remove postgre in ubuntu, and reinstall: https://stackoverflow.com/questions/23035111/psql-could-not-connect-to-server-no-such-file-or-directory-when-trying-to-run
createuser -U postgres -s YOURUSERNAME createdb YOURUSERNAME
sudo cat /var/log/postgresql/postgresql-9.6-main.log https://stackoverflow.com/questions/42653690/psql-could-not-connect-to-server-no-such-file-or-directory-5432-error/45090014
change password for postgre https://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist
(aiida) ywfang@ywfang:~$ sudo -u postgres psql [sudo] password for ywfang: psql (9.6.9) Type "help" for help.
postgres=# CREATE USER aiida1user WITH PASSWORD '123456'; ERROR: role "aiida1user" already exists postgres=# CREATE DATABASE django WITH OWNER aiida1user ENCODING 'utf-8'; CREATE DATABASE postgres=# CREATE DATABASE aiida1db WITH OWNER aiida1user ENCODING 'utf-8'; CREATE DATABASE postgres=# \q (aiida) ywfang@ywfang:~$ verdi daemon startStarting the daemon... RUNNING (aiida) ywfang@ywfang:~$ verdi daemon status Profile: aiidal1
(1)
didn't work any more, instead we use
(2)