How to backup a PostgreSQL database

In the following article you will find a few basic command for backups on PostgreSQL databases.

You can simply dump a database into a SQL file by using pg_dump

pg_dump db_name > /var/backups/db_name.sql

If you want to compress the output you can pipe the stream to gzip and the save it in a file:

pg_dump db_name | gzip > /var/backups/db_name.sql.gz


Enable remote access to MySQL database

Sometimes you might need to remotely access a MySQL database. As a security measure, by default that is prohibitted, but on your own responsibility we’ll show you how you can make it work.

There are two changes you should make on a clean MySQL installation – first enable the MySQL server to listen on all networks and second to create an user allowed to connect from any client.

Read More

How to disable swap on Linux

Swap is virtual memory mechanism that can provide additional system operating memory. When the system needs to free up some memory for applications, it temporarily moves data from the RAM to a storage device. Swaping is important for the operating system, but as storage drives are slower than the RAM memory, this process can sometime slow down a system. That’s why sometimes removing swap is neccessary.

Read More