This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Showing posts with label General Topic. Show all posts
Showing posts with label General Topic. Show all posts

Friday, September 7, 2018

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' - Mariadb running on RHEL7

Friday, September 07, 2018 0
Situation : 
                  I have tried to login as root to MariaDB Database in Linux Server, Getting below error.

[root@nsk ~]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

Solution: 
                We need to recover the root password of mariadb. Follow the below steps to achieve root password recovery.

STEP 1 : Stop the mariadb service
[root@nsk ~]# systemctl stop mariadb.service
[root@nsk ~]#

STEP 2 : Run mysql in safe mode
[root@nsk ~]# mysqld_safe --skip-grant-tables &
[1] 8051
[root@nsk ~]# 180907 13:23:49 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
180907 13:23:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

STEP 3 : Login as root and select mysql db. Then reset root password.
[root@nsk ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+-------------------------------+
| Database                      |
+-------------------------------+
| information_schema     |
| company                       |
| mydb                             |
| mysql                            |
| performance_schema   |
| test                                |
+-------------------------------+
6 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> update user set password=PASSWORD("NewPassword") where User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 3  Changed: 0  Warnings: 0

MariaDB [mysql]>
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> quit
Bye

STEP 4 : Now stop and start the mariadb service and test the new password.

[root@nsk ~]# systemctl stop mariadb.service
[root@nsk ~]#
[root@nsk ~]# systemctl start mariadb.service
[root@nsk ~]#
[root@nsk ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Hope it helps.

Thursday, January 25, 2018

How to extend the windows server disk space in command line

Thursday, January 25, 2018 0

Extending the windows server disk space in command line

Once the disk space added from storage to windows server.

Here, C drive is 75G and need to extend 25 GB. So total 100GB.

Go to command prompt and type disk part.


C:\Users\nsk>diskpart

C:\Users\nsk>

It will open a separate windows. Then follow the below steps to extend the C drive from 75GB to 100GB  (adding 25 GB)

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: TESTSERVER

DISKPART> list disk

  Disk ###  Status         Size          Free     Dyn  Gpt
  --------  -------------       -------         -------    ---   ---
  Disk 0    Online         75 GB        25 GB
  Disk 1    Online         6144 MB  1024 KB
  Disk 2    Online         12 GB       1024 KB
  Disk 3    Online         100 GB     1024 KB
  Disk 4    Online         225 GB       224 GB

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list part

  Partition ###  Type                 Size       Offset
  -------------  ----------------          -------     -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary              49 GB   101 MB

DISKPART> select part2

Microsoft DiskPart version 6.1.7601

DISK              - Shift the focus to a disk. For example, SELECT DISK.
PARTITION   - Shift the focus to a partition. For example, SELECT PARTITION.
VOLUME       - Shift the focus to a volume. For example, SELECT VOLUME.
VDISK           - Shift the focus to a virtual disk. For example, SELECT VDISK.

DISKPART> select part 2

Partition 2 is now the selected partition.

DISKPART> extend

DiskPart successfully extended the volume.

DISKPART> list disk

  Disk ###  Status           Size          Free          Dyn  Gpt
  --------  -------------         -------          -------            ---  ---
* Disk 0    Online           75 GB         0 B
  Disk 1    Online         6144 MB      1024 KB
  Disk 2    Online           12 GB         1024 KB
  Disk 3    Online          100 GB        1024 KB
  Disk 4    Online          225 GB         224 GB

DISKPART>

Hope it helps.

Tuesday, December 12, 2017

Net Backup Activity Monitor shows backup jobs are in Queued state

Tuesday, December 12, 2017 0

Net Backup Activity Monitor shows backup jobs are in Queued state 

Login to the backup server and check the queue status

[root@Backupmaster ~]#  bpdbjobs | grep -i Queued
4097609         Backup           Queued            TEST-P-DB-PMTNGS1       Full-Weekly      testserver1.local.com
4097588         Backup           Queued                TEST-P-FS-WIN                Full-Weekly      testserver2.local.com
4097587         Backup           Queued                TEST-P-FS-WIN                Full-Weekly      testserver3-bkp.local.com

Queued process are getting increased 

[root@Backupmaster ~]#  bpdbjobs | grep -i Queued | wc -l
136
[root@Backupmaster ~]#  bpdbjobs | grep -i Queued | wc -l
151

Cause : nbrb process has stopped, terminated  or hung state. So there is no resource allocation for new backup jobs.

Solution : In Linux Backup Master server, run the below command.

#/usr/openv/netbackup/bin/nbrb

Now queued process are changed to Active state also in  job-details, can see the backup jobs are started.

Saturday, December 9, 2017

NTP client configuration in Windows Server - PowerShell

Saturday, December 09, 2017 0
Below procedure is used to configure NTP  client on windows server (power shell commands)

Open Power Shell as Administrator

Run the below commands

PS C:\Users\testuser>w32tm /config /manualpeerlist:"0.rhel.pool.ntp.org 1.rhel.pool.ntp.org 2.rhel.pool.ntp.org 3.rhel.pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org" /syncfromflags:MANUAL

PS C:\Users\testuser>Stop-Service w32time
PS C:\Users\testuser>Start-Service w32time

PS C:\Users\testuser>w32tm /query /status

PS C:\Users\testuser> w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 3 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0625000s
Root Dispersion: 0.3055127s
ReferenceId: 0xAC18000B (source IP:  172.0.0.11)
Last Successful Sync Time: 12/7/2017 8:44:49 AM
Source: 0.rhel.pool.ntp.org
Poll Interval: 15 (32768s)

PS C:\Users\testuser>w32tm /resync

Wednesday, December 6, 2017

Integrated Lights Out Manager Command to Turn On or Turn Off the Locator Indicator Remotely

Wednesday, December 06, 2017 0

Integrated Lights Out Manager Command  to Turn On or Turn Off  the Locator Indicator Remotely  

Below  Integrated Lights Out Manager Command is used to Turn On or Turn Off  the locator indicator .

Turn on the Locator indicator, type the following command at the  ILOM prompt:
set /System/ locator_indicator=on

Turn off the Locator indicator, type the following command at the ILOM prompt:
set /System/ locator_indicator=off

–> show /System/ locator_indicator

The output of the command appears:

/System

Properties:

locator_indicator = Off

The value locator_indicator shows the status as either On or Off.