Long story short: I was deploying one of my platforms on a virtual machine running Ubuntu 16.04.
As usual I start by installing Apache, Mod Python, my preferred editor (Geany), copy the Python files in the right place and here we reach a more complex step ... getting the database up.
Actually it is not complex but there are some things that you have to remember. If you don't do it in the correct order you might loose some time getting it right and this just happened to me yesterday so this morning I decided to write this post. Why? Because everywhere I look on the web the script is bloated with stuff that is not needed.
Here we are:
# Open terminal and install PostgreSQL as following:
sudo apt-get install postgresql libpq-dev postgresql-client postgresql-client-common
# Open pg_hba.conf to see if everything is OK.
# Your current PostgreSQL version might be different (mine is 9.5 as you can see)
# please see yours and change the path bellow accordingly
sudo nano /etc/postgresql/9.5/main/pg_hba.conf
# You should see the following line immediately after the long comments at the beginning:
local all postgres peer
# if different please make it look with the example given, save the file (CTRL+O) and exit nano (CTRL+X)
# restart the service (not needed if you did not changed the file)
sudo service postgresql restart
# Enter PostgreSQL cursor
sudo -u postgres psql
# Now you are at the helm and can start doing the actual interesting stuff
# Get control over postgres user ... you will need it :)
ALTER USER postgres PASSWORD 'password1';
# Create your custom user
CREATE USER my_user;
ALTER USER my_user PASSWORD 'password2';
# This one depends on what you need to do with your user
ALTER USER my_user WITH SUPERUSER;
# Create the database
CREATE DATABASE my_database;
GRANT ALL privileges ON DATABASE my_database TO my_user;
# Now you can exit postgres command line and add pgadmin3 to do the rest of the stuff using a GUI
sudo apt-get install pgadmin3
Enjoy :)
Showing posts with label database. Show all posts
Showing posts with label database. Show all posts
Should we say "Goodbye MySQL"?
Well the question is more or less a remark not a real question.
Oracle buys SUN. That makes everything clear. When the same phrase contained IBM instead of Oracle I did not had any issues. But now ...
It does not make much sense for Oracle to keep MySQL in it's stack. That is very clear for everybody.
What has this to do with the publishing area? It has a lot.
When you say publishing you say information and storage and architecture and presentation.
For most part of the modern publishing that means at least partially: databases.
Except for the OS and the programing language, the database is one of the core technologies you use when you do web publishing or you present yourself to the world using the web.
To be fair I'm not as disturbed as you might think. I use MySQL a lot but ... but it is by no means the only database I use (the other is Postgres).
In the end this might even be helpful for the publishing area as a whole. Who knows. May be XML will gain some momentum because the easiest way to avoid using it for most programmers was to use MySQL. Now they might face an interesting situation: they have a number of choices and XML has it's advantages.
Oracle buys SUN. That makes everything clear. When the same phrase contained IBM instead of Oracle I did not had any issues. But now ...
It does not make much sense for Oracle to keep MySQL in it's stack. That is very clear for everybody.
What has this to do with the publishing area? It has a lot.
When you say publishing you say information and storage and architecture and presentation.
For most part of the modern publishing that means at least partially: databases.
Except for the OS and the programing language, the database is one of the core technologies you use when you do web publishing or you present yourself to the world using the web.
To be fair I'm not as disturbed as you might think. I use MySQL a lot but ... but it is by no means the only database I use (the other is Postgres).
In the end this might even be helpful for the publishing area as a whole. Who knows. May be XML will gain some momentum because the easiest way to avoid using it for most programmers was to use MySQL. Now they might face an interesting situation: they have a number of choices and XML has it's advantages.
Subscribe to:
Posts (Atom)