osm2pgrouting --f your-OSM-XML-File.osm --conf mapconfig.xml --dbname routing --username postgres --clean
Execution starts at: Tue Jul 14 15:40:48 2020
COMMAND LINE CONFIGURATION *
Filename = your-OSM-XML-File.osm
Configuration file = mapconfig.xml
host = localhost
port = 5432
dbname = routing
username = postgres
schema=
prefix =
suffix =
Drop tables
Don't create indexes
Don't add OSM nodes
Testing database connection: routing
fe_sendauth: no password supplied
@atene468
# work on the home folder
cd
# login to postgres
psql -U postgres
-- Create youruser
CREATE ROLE youruser SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD 'your_pass';
-- exit psql
\q
# Add the user to .pgpass
echo :5432:*:youruser:yourpass >> .pgpass
Then try with
osm2pgrouting --f your-OSM-XML-File.osm --conf mapconfig.xml --dbname routing \
--username youruser \
--clean
createdb foo
?
createdb foo
just like that without sudo is because you dont have in pgpass your name and password