Wednesday, October 26, 2022

MySQL Error : which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

 I got mysql error when executing a command

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Solution to fix :

- Login to your server as root

- Open your mysql configuration file (for me its /etc/mysql/mysql.conf.d/mysqld.cnf)

- Add the following code after [mysqld] block

[mysqld]

sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

- Restart mysql service ( systemctl restart mysql )

Issue fixed

Monday, September 19, 2022

GIT operations in day to day life

 GIT operations

To configure your name and email in your local settings:


# git config --global user.name "Name"

# git config --global user.email "Email"

git config -l


To Clone the git repo:


git clone https://git-url/project.git


To play around the branches :


git branch

git branch -r

git switch <branch-name> 


To push from local repo to git repo:


# git add .

git commit -m "First commit"

git push -u origin <branch-name> 

Wednesday, September 14, 2022

How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

 How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

OS : Ubuntu 16.04 LTS

Prometheus version : 2.22

# /usr/local/bin/prometheus --version

prometheus, version 2.22.0 (branch: HEAD, revision: 0a7fdd3b76960808c3a91d92267c3d815c1bc354)


Confirm that prometheus datas are in # ll /var/lib/prometheus

Take a backup of this data to a safe location


Confirm the path of prometheus and promtool # /usr/local/bin/

Take a backup of this data to a safe location


Stop prometheus and grafana services


# systemctl stop prometheus

# systemctl stop grafana-server


Download the latest prometheus. In my case its 2.38 and I downloaded to /mnt folder.


# cd /mnt

wget https://github.com/prometheus/prometheus/releases/download/v2.38.0/prometheus-2.38.0.linux-amd64.tar.gz

# tar -xvf prometheus-2.38.0.linux-amd64.tar.gz

# cd prometheus-2.38.0.linux-amd64

# cp prometheus /usr/local/bin/

# cp promtool /usr/local/bin/

# chown prometheus:prometheus /usr/local/bin/prometheus

# chown prometheus:prometheus /usr/local/bin/promtool

# cp -r consoles /etc/prometheus/

# cp -r console_libraries /etc/prometheus/

# chown -R prometheus:prometheus /etc/prometheus


Start prometheus and grafana services


# systemctl start prometheus

# systemctl start grafana-server


Check the prometheus version

# /usr/local/bin/prometheus --version

prometheus, version 2.38.0 (branch: HEAD, revision: 818d6e60888b2a3ea363aee8a9828c7bafd73699)

Sunday, August 21, 2022

Yum error : Loaded plugins: versionlock

 [opc@dbdemo ~]$ sudo yum install iptables-services

Loaded plugins: versionlock

There are no enabled repos.

 Run "yum repolist all" to see the repos you have.

 To enable custom repositories:

     yum-config-manager --enable <repo>

[opc@dbdemo ~]$

The above is the error getting while issue yum command. My OS is Oracle Linux 7.9

Solution to fix the error:

Login to the server as root

# wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle


# gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle


# vi /etc/yum.repos.d/ol7-temp.repo


[ol7_latest]

name=Oracle Linux $releasever Latest ($basearch)

baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

gpgcheck=1

enabled=1


# yum install oraclelinux-release-el7


# mv /etc/yum.repos.d/ol7-temp.repo /etc/yum.repos.d/ol7-temp.repo.disabled


# yum update -y


Now yum install iptables-services works without any error

References : 

https://yum.oracle.com/faq.html#a10

https://yum.oracle.com/getting-started.html#installing-from-oracle-linux-yum-server