![]() There are few very good tools available, like Valentina Studio which gives you a nice user interface to get connected and do your stuffs with postgresql. ![]() Once you are connected you can play easily with postgresql. Now you can use the the below command to login to your database again by using the following command. Change the line local all postgres peerĬhange the password of user postgres postgres=# ALTER USER postgres PASSWORD 'newPassword' Ĭreate a database postgres=# CREATE DATABASE myDB Ĭreate a user postgres=# CREATE USER paul WITH PASSWORD 'myPassword' Īssign access postgres=# GRANT ALL PRIVILEGES ON DATABASE myDB to paul Įxit from existing connection postgres=# \q If you are using ubuntu or linux please edit the file /etc/postgresql/9.X/main/pg_hba.conf to change the authentication from peer to md5. Once you are inside the database, you can create more databases and users to communicate with the database. Postgres is the default user of postgresql database and it doesn’t have a password by default. The postgres in the line 1 is the user and in line 2 is the database name. Now, as your database is up and running, you can now start playing with the actual database queries. $ launchctl load -w ~/Library/LaunchAgents/ $ cp /usr/local/Cellar/postgresql/9.2.1/ ~/Library/LaunchAgents/ In mac it’s a combination of few commands. When finished let’s check if is working by typing on the terminal. You just need to start that and you are good to go. Now that you have, let’s install it by doing it on the terminal: brew install postgresql. The installation command using apt-get already created a service named postgresql. Start in ubuntu/linux $ service postgresql start As we’ve installed postgres in two different ways in linux and mac, similarly to start the server also we need to run different kind of commands in two different OSs. Running / Starting the database serverīefore anyone uses the database, it’s necessary to start the server. The installation of postgresql is done now. #the above command to install xcode will throw you graphical UI to operate.Īfter having homebrew in your mac, you can go ahead to install postgresql by running the following commands. If you don’t have homebrew already installed, you can run the following commands to install that. in MacĪs mac doesn’t have apt-get, we can go with other package managers like homebrew and mackports. It may ask for admin rights and you may have to run these with sudo. in ubuntu/linux $ apt-get install postgresql I am showing you steps to install from terminal. You can download the appropriate setup from official site and clicking is enough. ![]() Graphical installation in any OS is relatively easier. This will also show you how to write the first query, so that after finishing the article you get all set to start using postgresql. This article describes the installing and starting the postgresql in simple steps.
0 Comments
Leave a Reply. |