Closed UnoDean closed 5 years ago
You don't need to enter a password on macOS
, you can refer to my configuration here....
#if os(Linux)
return PostgreSQLDatabaseConfig(hostname: hostname,
port: port,
username: username,
database: database,
password:password)
#else
return PostgreSQLDatabaseConfig(hostname: hostname,
port: port,
username: username,
database: database)
English is not my native language; please excuse typing errors.
You don't need to enter a password on
macOS
, you can refer to my configuration here....#if os(Linux) return PostgreSQLDatabaseConfig(hostname: hostname, port: port, username: username, database: database, password:password) #else return PostgreSQLDatabaseConfig(hostname: hostname, port: port, username: username, database: database)
English is not my native language; please excuse typing errors.
it's works. Thanks!
💪💪 You're welcome !
I am setting my database configuration as below: let hostname = Environment.get("DATABASE_HOSTNAME") ?? "localhost" let username = Environment.get("DATABASE_USER") ?? "vapor" let databaseName = Environment.get("DATABASE_DB") ?? "vapor" let password = Environment.get("DATABASE_PASSWORD") ?? "password" let databaseConfig = PostgreSQLDatabaseConfig(hostname: hostname, username: username, database: databaseName, password: password ) let database = PostgreSQLDatabase(config: databaseConfig)
but I am getting this error "Fatal error: Error raised at top level: ⚠️ PostgreSQL Error: Password is required" Please provide a solution for this problem
Use "PostgreSQLDatabaseConfig(hostname: "localhost", port: 5432, username: "postgres", database: "postgres", password: "123456")" crash log: PostgreSQL Error: No password is required- id: PostgreSQLError.trust But I found this issue “https://github.com/vapor/fluent-postgresql/issues/22” has been closed