Thursday, October 16, 2014

My SQL



Issues:
1) Conn't connect to mysql gives following error:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 


mysqldump -uroot -p****** metastore > /tmp/divakar.sql


mysqldump -uroot -p***** metastore < /tmp/divakar.sql

Hadoop Administration Part 15 : Sentry


Friday, October 3, 2014

Shell Scripting Part 1

[root@script]# cat first.sh
# my first program
#clear
echo "Knowledge is power"
[root@ebdp-wc-d01d script]#

./first.sh
Knowledge is power
-------------------------------------------
Script to print user information who currently login , current date & time
[root@ebdp- script]# cat userinfo.sh
#user info who logged into system date & time
echo "Hello $USER"
echo "Today's date is ";date
echo "Number of user login ";  who | wc -l
echo "Calender"
cal
exit 0
[root@ebdp-script]#
-----------------------------------------
[root@ebdp-wc-d01d script]# cat math.sh
echo "your first name please:"
read fname
echo "Hello $fname, have a fun"
[root@ebdp-wc-d01d script]#
--------------------------------------
vi script.sh
#! /bin/bash
echo "Hello World"
chmod +x script.sh
./script.sh
output:
Hello World
---------------------------------------
-sh-4.1$ which bash
/bin/bash
-sh-4.1$
--------------------------
-sh-4.1$ cat sample1_string.sh
#! /bin/bash
STRING="Hellp World"
echo $STRING
-sh-4.1$
-sh-4.1$ chmod +x sample1_string.sh
-sh-4.1$ ./sample1_string.sh
Hellp World
---------------------------------------