Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, June 9, 2010

Mysql installation on linux

   1. Become the superuser if you are working in your account. (Type "su" and the prompt and give the root password).
   2. Change to the directory that has the RPM download.
   3. Type the following command at the prompt:

      rpm -ivh "mysql_file_name.rpm"

      Similarly you can also install the MySQL client and MySQL development RPMs if you've downloaded them.
      Alternatively, you can install the RPMs through GnoRPM (found under System).
   4. Now we'll set a password for the root user. Issue the following at the prompt.

      mysqladmin -u root password mysqldata

      where mysqldata is the password for the root. (Change this to anything you like).
   5. It is now time to test the programs. Typing the following at the prompt starts the mysql client program.

      mysql -u root -p

      The system asks for the the password. Type the root password (mysqldata).
      If you don't get the prompt for password, it might be because MySQL Server is not running. To start the server, change to /etc/rc.d/init.d/ directory and issue the command ./mysql start (or mysql start depending on the value of the PATH variable on your system). Now invoke mysql client program.
   6. Once MySQL client is running, you should get the mysql> prompt. Type the following at this prompt:

      show databases;

   7. You should now get a display similar to:

      +----------------+
      | Database       |
      +----------------+
      | mysql          |
      | test           |
      +----------------+
      2 rows in set (0.00 sec)

Okay, we've successfully installed MySQL on your system. Now let's look at some MySQL basics.

Java installation on linux box.

Install java on linux machine  (http://www.meritonlinesystems.com/docs/apache_tomcat_redhat.html)

DOwnload page for java : http://java.sun.com/j2se/1.4.2/download.html

I chose the J2SE v1_4_2_12 SDK Linux self-extracting binary file. (j2re-1_4_2_12-linux-i586.bin,j2sdk-1_4_2_12-linux-i586.bin present in /usr/local/java directory)

1.Change to the directory where you downloaded the SDK and make the self-extracting binary executable:

chmod +x j2sdk-1_4_2_12-linux-i586.bin

2.Run the self-extracting binary:

./j2sdk-1_4_2_12-linux-i586.bin

3.There should now be a directory called j2sdk1.4.2.12 in the download directory.
Move the SDK directory to where you want it to be installed. I chose to install it in /usr/local/java.
Create /usr/local/java if it doesn't exist. Here is the command I used from inside the download directory:

mv j2sdk1.4.2.12 /usr/local/java

4.Set the JAVA_HOME environment variable, by modifying /etc/profile so it includes the following:
JAVA_HOME="/usr/local/java/j2sdk1.4.2.12"
export JAVA_HOME

Note : /etc/profile is run at startup and when a user logs into the system, so you will need to log out and log back in for JAVA_HOME to be defined.
exit
su -

5.Check to make sure JAVA_HOME is defined correctly using the command below. You should see the path to your Java SDK.
echo $JAVA_HOME

also do following if java not orking
PATH=$PATH:/usr/java/j2sdk1.4.2_03­ /bin
JAVA_HOME=/usr/java/j2skd1.4.2_03
export PATH


Installation of RPM File

It requires root access to install.

1. Run the rpm command to install the packages that comprise the Java 2 SDK:

rpm -iv jdk-6u2-linux-i586.rpm

2. Delete the bin and rpm file if you want to save disk space.



Note: By default, the .rpm is installed in /usr/java. Use which javac to ensure the classpath was setup correctly.

TO Uninstall any rpm use following command
rpm -e

Linux - Samba Mount

Bellow are the steps for samba mounting :

1)  Share the folder on Windows machine.e.g on "1521.1101.1491.2271" windows machine I have shared "DocumentRepository" folder.
    Give full access to any user e.g administrator

2) Create directory on Linux box on which you want mount.
    e.g  /u/ServicesPortal/DocMgmtAttachments

3) Edit /etc/fstab file and make entry for your mount . Please refer attached file for your referemce
    e.g //1521.1101.1491.2271/DocumentRepository /u/ServicesPortal/DocMgmtAttachments smbfs credentials=/etc/samba/siebelFile.credential 0 0
   Note : In fstab file, line starting with "#" represents comment.

4) Create credential file required for mountig. Please find attached credential file for your reference.
    In above example we have credential file at /etc/samba/siebelFile.credential  location.
    It contains following entry :
  username=administrator
  password=administrator

5) Now run following command for mounting
    Command is : "mount -a"

6) To check mounting is done or not, run following command which will show you alla mounts
    Command is :  "mount"

7)  for mannual mount use
mount -t smbfs -o username=Nihilent,password=N3wp@55,workgroup=augsoa //1521.1101.01.361/DocumentRepository  /u/ServicesPortal/DocMgmtAttachments


Note :
a) fstab file looks as bellow


# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/hdc                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0

#Following mount is used as a alternative to CMDB mount (Represents portal file server location)
//1521.1101.1491.2271/DocumentRepository /u/ServicesPortal/DocMgmtAttachments smbfs credentials=/etc/samba/siebelFile.credential 0 0

----------------------------------------------------------------------------------------------------------
b) siebel.credential file looks as bellow :


username=siebfiles
password=siebfiles
gid=UKLHCSVSBLWEBBL