How to start stop PostgreSQL on Ubuntu

This article covers how to start, stop and restart PostgreSQL on Ubuntu. This is PostgreSQL DBA routine task.
We are going to cover stop, start and restart using service and systemctl commands. But, not covering to kill the PostgreSQL process from Linux shell.

Stop Start and Restart PostgreSQL using service:

sudo service postgresql stop sudo service postgresql start sudo service postgresql restart

Examples for How to start stop PostgreSQL on Ubuntu:
Continue reading How to start stop PostgreSQL on Ubuntu

Install PostgreSQL 11 on Ubuntu 19.04

In this article, we are going to install PostgreSQL 11 on Ubuntu 19.04 Linux server.

Step1: Add PostgreSQL Repository:

So you need to add PostgreSQL apt repository to your system suggested on official PostgreSQL website using following commands.

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

Continue reading Install PostgreSQL 11 on Ubuntu 19.04

Sybase revoke permission

In this article, we are going to see how to revoke permissions from Sybase user on a table(s).

Sybase Revoke Syntax:

revoke [grant option for] {all [privileges] | permission_list} on {table_name [(column_list)] | view_name [(column_list)] | stored_procedure_name | function_name | keyname} [with {pred_name | {all |no} predicates}] from {public | name_list | role_list} [cascade] [granted by grantor]

Continue reading Sybase revoke permission

MongoDB exception: connect failed

When tried to connect to MongoDB server, recieved the error: “MongoDB exception: connect failed”. This error occurs if MongoDB server is offline or It may be connecting with default port 27017.

MongoDB shell version v4.0.10 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb 2019-07-09T22:18:34.660-0700 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:344:17 @(connect):2:6 exception: connect failed

Reason:

Possible reason check the MongoDB server is up and running fine or not. In my case this error came because MongoDB server is down.

MongoDB exception connect failed

Solution 1:
Continue reading MongoDB exception: connect failed

Sybase Ad-hoc updates to system catalogs not enabled

I have received this when tried to bcp in of the system table ‘sysusers’ in Sybase.

Server Message: LOCALHOST - Msg 10321, Level 14, State 1: Ad-hoc updates to system catalogs not enabled. A user with System Security Officer (SSO) role must reconfigure system to allow this. CTLIB Message: - L1/O3/S0/N14/0/0: blk_init(): blk layer: CT library error: Failed when CT_Lib routine ct_results() called. blk_init failed. bcp copy in failed

Reason:
This occurs when you try to directly modify an Adaptive Server system table without first using sp_configure to set the allow updates configuration parameter.

Solution: Continue reading Sybase Ad-hoc updates to system catalogs not enabled

Sybase database refresh step by step

In this article, we are going to see step by step procedure of Sybase database refresh.

Steps to perform refresh:

1. Prerequisites.
2. Backup and SCP
3. Load
4. Verification

Source Information:

Source Database Servername: LOCALHOST(Sybase server name)
IP: 192.168.152.130
Source Database name: r2schools

Target Information:

Tartget Database Servername: DEV01(Sybase server name)
IP: 192.168.152.135
Target Database name: r2dev
Continue reading Sybase database refresh step by step

PuTTY Fatal Error Network error: Connection timed out

I have faced the issue when connecting to CentOS Server or Ubuntu Server using putty thrown error “PuTTY Fatal Error:Network error: Connection timed out” on Ubuntu and CentOS which are virtual machines installed on VMWare.

PuTTY Fatal Error Network error: Connection timed out

Solution PuTTY Fatal Error Network error: Connection timed out on Ubuntu:
Continue reading PuTTY Fatal Error Network error: Connection timed out

ERROR 1698 (28000): Access denied for user root

This problem occurs from the mysql versions 5.7.+ on wards.
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’.

1. It is because MySql 5.7 by default allow to connect with socket, which means you just connect with sudo mysql

use mysql;

2. Run the following select statement:

SELECT user,authentication_string,plugin,host FROM mysql.user;

Continue reading ERROR 1698 (28000): Access denied for user root