Posts

Solution: "MySQL is running but PID file could not be found"

If sometime, mysql status shows that " ERROR! MySQL is running but PID file could not be found ", after checking the mysql status like below: etc/init.d/mysql status ERROR! MySQL is running but PID file could not be found To solve this issue, please kill all the mysql daemon. ps aux | grep mysql kill -9 pid1 pid2 ... Now start the mysql, /etc/init.d/mysql start  

Reset forgotten mysql root password

Here is the steps to reset mysql password in case of one forget it. Note: One must have linux root login credential. Step 1: Open a terminal, and login using root linux password. Firstly, stop mysql daemon, using the below command: /etc/init.d/mysql stop or, service mysql stop Step 2: Start the mysql server manually without permission of tables which will allow to login as root user without password. Use the following command: mysqld_safe --skip-grant-tables 120730 08:53:40 mysqld_safe Logging to '/var/lib/mysql/MBS-APPS.err'. 120730 08:53:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Step 3: Now open a new window and start mysql without any password: mysql --user=root mysql Step 4: Now reset the mysql root password, UPDATE user SET password=PASSWORD('newpassword') WHERE user='root'; flush privileges; exit; Step 5: Password will successfully reset. Now kill all mysqld process. ps -ef|grep -i mysql   kill -...

To extract substring between two character: Shell Script

var1='mysql-' var2='-linux' mysqlFromWhichCommand=/usr/local/mysql-5.1.38-linux-i686-icc-glibc23/bin/mysql versionMysql=`echo "$mysqlFromWhichCommand" | sed -e "s/.*${v1}//;s/${v2}.*//"`` echo "MySql version: $versionMysql"

Azim Dada, no more ..... innalillah he wa inna ilaihe rajeoun

Yesterday on 9th June, 2012, Azim dada, one of my cousins passed away. May Allah bless him and his family with peace. He was around 36 yrs, with two boy (one at class 7th and other is  yrs old) and a daughter (3 years old). Very funny, well mannered, well build, helpful personality he had. He owned a bi-cycle shop near Beta-Sineth more. Cause of death was, due to minor accident in bypass of Durgapur Expressway, near Moshat. Allah, please save his family.

Get email ids from a given text or email corpora using Regex and Java

Here is the example to get all email ids from a email corpora or text: package com.Nur; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Emailvalidation {     /**      * @param args      * @author nur.haldar      * @return      */     public static final String EXAMPLE_TEST = "This is the emailid: nur.haldar@comviva.com" +             " from where" +             " the mail was sent to NURJAMIA@gmail.com. Please check " +             "the two email ids are valid or not";     public static void main(String[] args) {         String regex = "\\b[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}\\b";         Pattern pattern =...

Check valid Email Id using Regex in Java

Any email id is of the form: abc.xyz@company.com or abc23.xyz@company.co.uk or abc_34year@company.com . One can validate these emails using regular expression in Java. Below is a program which can replace the email ids with a word 'EMAIL'. package com.Nur; public class Emailvalidation {     /**      * @param args      * @author nur.haldar      * @return      */     public static final String EXAMPLE_TEST = "This is the emailid: nur.haldar@comviva.com" +             " from where" +             " the mail was sent to nurjamia@gmail.com. Please check " +             "the two email ids are valid or not";     public static void main(String[] args) {         //String nameRegex = "[A-Z][a-z]+\s\s?[A-Z][...

Regular Expression in Java

Quick Study of Regex: Common Syntax to be remember: Regular Expression Description . Matches any sign ^regex regex must match at the beginning of the line regex$ Finds regex must match at the end of the line [abc] Set definition, can match the letter a or b or c ...