I've installed PostgreSQL 9 on Mac OS. I need to change the configuration so that I can access Postgre with the blank password. Searching online yields lots of solutions for older versions of the software, butt I don't know if they apply to the newer version.
Many solutions discuss a.conf file of sorts, but the only config files are.conf.sample in the Postgre directories. My root user now has a blank password. Having this blank password seems to result in an error when I try to connect or set a new password. I recieve this when trying to connect with the empty password: psql: fesendauth: no password supplied How can I change the password and/or enable the conf files? Your PostgreSQL administrator account is most likely postgres.
Install PostgreSQL 11 on Mac OS X via brew. PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. How to install PostgreSQL 9.6 on Mac OS X (10.7 or later) PostgreSQL is an open source relational database system that has been around for well over a decade and has proven to be a great all around storage choice when developing a web application. In this guide we are going to walk through installing PostgreSQL 9.6 on Mac OS X (10.7 or later).
You can log in as postgresql administrator by first becoming postgres mac user sudo -i -u postgres. Then you can access PostgreSQL prompt with psql. To change administrator password: ALTER USER postgres PASSWORD 'somepassword'. To allow logging in without password, you need to edit pghba.conf, which probably resides in /Library/PostgreSQL/9.0/data/pghba.conf. I use ident authentication to allow mac user jkj to log in as PostgreSQL user jkj without password. # TYPE DATABASE USER CIDR-ADDRESS METHOD local all jkj ident Remember that you first have to create your username in PostgreSQL.
It can be a superuser. Createuser -s jkj.
Install PostgreSQL via Homebrew Likely most OS X users know of, but Homebrew is a package manager for OS X that allows you to easily install and run a massive library of applications and utilities with ease. We won’t go through the entire (albeit short) installation process of Homebrew, but if you wish to install Homebrew and use it for PostgreSQL management, check out the installation command on the. If you aren’t sure if Homebrew is installed, try the which brew command from the terminal to verify. Once Homebrew is installed, you can install PostgreSQL by issuing the following commands in your terminal. $ brew update $ brew doctor $ brew install postgres The first two commands are used to update Homebrew and report any potential issues (if necessary).
Then, of course, brew install postgres is the one-line command for installing PostgreSQL. You should see a good deal of useful information in the output during installation, much of which should be copied down for use in the next sections.
Using a LaunchAgent and plist to Launch PostgreSQL on Startup In most cases, you’ll likely wish to have PostgreSQL launch when you start up your system, so you’ll need to tell your computer this is your desire. First, you’ll need to create a directory for your LaunchAgents to reside (if the directory doesn’t exist already).
LaunchAgents in OS X are simple scripts used by that cause the system to run programs or code during startup. Create your user-specific LaunchAgents directory with this command, if necessary. $ mkdir -p /Library/LaunchAgents Now you’ll need to create a symbolic link from the script that actually allows Postgres to run to the LaunchAgents directory. A symbolic link is similar to creating a new copy of a file for use in another directory, but since the link is ‘symbolic’, the link is just a forwarding address: any request made to that symbolic link location is actually “forwarded along” or redirected to where the real file actually resides.
Link to the plist (property list) file that was generated by Homebrew and place that new symbolic link in LaunchAgents with this command. $ ln -sfv /usr/local/opt/postgresql/.plist /Library/LaunchAgents Note: Double-check that the command is correct: It should’ve been part of the installation output mentioned above when Homebrew installed Postgres initially. Finally, we load the new symbolic link’ed LaunchAgent file using the launchctl load command, which is specifically what informs the computer to run this script and start Postgres when the computer launches. Again, the exact command to enter for your own installation will be an output during Homebrew’s Postgres installation, but it should look something like this.