8/28/2023 0 Comments Postgresql command line mac![]() In case you’re using this guide to get started using rails here’s how I would start the new rails app. To exit the shell hit Ctrl+ d Starting a new Rails project The -U means to login using that username and the -W means to prompt for a password. The following command can be used to log into the database. The -O indicates the user that will become the owner of the database. Create a databaseĬreatedb -Otunnelsup -Eutf8 mysite_development If you wish to create a user without a password just take the -pwprompt off the command. If it asks you questions about the user you can say ‘n’ for all of the questions. Use it right from the OSX terminal command line like this: Postgres has a shell command called createuser which will create a user for Postgres. Additional Postgres Commands Create a user Now when the computer reboots, postgres will automatically startup. Now use launchctl to load the file using this command: I found mine at /usr/local/Cellar/postgresql/9.3.4/.Ĭopy the plist file to the LaunchAgents directory.Ĭp /usr/local/Cellar/postgresql/9.3.4/ ~/Library/LaunchAgents/ Create it if it doesn’t exist.įind the plist file that came with the postgres install. ![]() Initdb /usr/local/var/postgres Set up Postgres to run at startupĬheck if the directory ~/Library/LaunchAgents exists. ![]() Then simply run the command:īrew install postgres Initialize Postgres Configure your PATH to use the included command line tools (optional): sudo mkdir -p /etc/paths.d & echo /Applications/Postgres. If you don’t have homebrew, install it first. Another way to check your PostgreSQL version is to use the -V option: postgres -V These two commands work with installations initiated from official repositories. I am saving my notes here in case that site gets removed. Access your terminal and enter the following command to check your PostgreSQL version: postgres -version The version number is displayed in your terminal window. Most of what is written here was learned from this blog post. Here are the steps I used to set up Postgres in Mac OSX.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |