-
Notifications
You must be signed in to change notification settings - Fork 0
/
DBSetupTroubleshooting.txt
74 lines (41 loc) · 1.87 KB
/
DBSetupTroubleshooting.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
How to set up db so the databaseManager.c will work on your BeagleBone
(Assumes you have installed and instantiated postgresql on your BeagleBone)
change to be postgres user with:
# su - postgres
Create database, user, password:
$ createuser admin_433
$ createdb vending_machine
change to psql console:
$ psql
set password for admin_433:
psql=# alter user admin_433 with encrypted password 'teambato';
psql=# grant all privileges on database <dbname> to <username>;
Now do the following
postgres@<yourid>-beagle: psql -U admin_433 -d vending_machine -a -f "<absolute path to setup.sql script>"
or (following assumes setup.sql is copied to your NFS share folder)
psql -U admin_433 -h 127.0.0.1 -d vending_machine -a -f "/mnt/remote/setup.sql"
Troubleshooting
If getting following error when trying to start psql console:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting connections on
Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Check what database cluster currently created/running:
# pg_lsclusters
If there is one, but it's not running, then start it (substituting the version and name):
# pg_ctlcluster <x.y> <name> start
(x.y is version number listed in result of pg_lsclusers, for me it was 9.4 main)
If there isn't one, create one and have it started:
# pg_createcluster --start x.y name
If you get error along the lines of
"Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlclust"
change permissions to the directory with
# chmod 755 /usr/bin
If you get an error then you need to free up space on the target run:
#sudo apt-get remove --purge x11-common
#sudo apt-get autoremove
If there are authentication issues when running node
modify # /etc/postgresql/9.4/main/pg_hba.conf
local all postgres peer
Should be
local all postgres md5
(may need to change other lines to md5)