Sunday, March 29, 2009

How to install MySQL On Ubuntu

Follow the instructions in this article to help you install MySQL and MySQL Query Browser on Ubuntu.

Installing MySQL on Ubuntu:

To open the Terminal, go to Application > Accessories > Terminal




Type the following command at terminal.

*

$sudo apt-get install mysql-server

To be able to connect to mysql from internet, remove the restriction on the below file.

*

Open the file by typing the following command at terminal prompt.

$gksudo gedit /etc/mysql/my.cnf

*

Find the line bind-address = 127.0.0.1 and comment it out as shown below.




#bind-address = 127.0.0.1

*

mysql comes with no root password. To set the root password, type:

$mysqladmin -u root password your-new-password

$sudo /etc/init.d/mysql restart

*

Install mysql query browser

$sudo apt-get install mysql-query-browser

*

After installing, go to Applications > Programming > MySQL Query Browser to connect to mysql as shown below.




Enter Server Hostname, Username and Password. Click on Connect and MySQL is now installed on Ubuntu.

Wednesday, November 5, 2008

How to install Java and Tomcat6 for Ubuntu 8.04

For Ubuntu 8.04, hope this little contribution can help you installing Java and setting your tomcat server.

Step 1. Download the latest Tomcat to your desktop: http://tomcat.apache.org/download-60.cgi , then run

sudo tar zxvf apache-tomcat-6.0.10.tar.gz (or name of the latest downloaded tomcat .gz file).
sudo cp -R apache-tomcat-6.0.10 /usr/share/tomcat6 (or name of the unziped tomcat file).

Step 2. Setting JAVA environment
Download the latest J2SE SDK from http://java.sun.com/javase/downloads/index.jsp, and run
sudo chmod +x *.bin
sudo sh ./jdk*.bin

Executing the .bin file creates a folder on your desktop named jdk1.6.0_01(or latest java version folder).
Rename that folder to Java6u1. Now move that folder to /usr/lib

sudo mv Java6u1 /usr/lib
sudo update-alternatives --install /usr/bin/java java /usr/lib/Java6u1/bin/java 300
sudo update-alternatives --config java

1 /usr/lib/Java6u1/bin/java
2 /usr/bin/gij-wrapper-4.1
3 /usr/lib/jvm/java-gcj/jre/bin/java

you will get a list that looks like above. now select that we recently copied one. here option 1.

Step 3. Setting the following environment /etc/environment
sudo gedit /etc/environment,
then insert and save two lines:
CLASSPATH=.:/usr/lib/Java6u1/bin (or latest path based on your naming )
JAVA_HOME=/usr/lib/Java6u1 (or latest path based on your naming)

Step 4: Tomcat needs to set JAVA_HOME or JRE_HOME to execute.
Open the follow document and edit the lines:

sudo gedit ~/.bashrc
then place the following lines in:

export JAVA_HOME=/usr/lib/Java6u1 ( or your latest path based on your naming)
export PATH=$PATH:$JAVA_HOME/bin

Step 5: Start and stop tomcat
Now start your tomcat:
sudo /usr/share/tomcat6/bin/./startup.sh
Type "http://localhost:8080" in your browser. If you see the tomcat welcome page, your tomcat is running smoothly.
If you are installing below 5.5 version, please try 8180.

Stopping tomcat:
sudo /usr/share/tomcat6/bin/./shutdown.sh

Step 6: Tomcat administrator setting
Edit this document:
sudo gedit /usr/share/tomcat6/conf/tomcat-users.xml
before insert this line:

Save and restart your tomcat. You can login to your tomcat admin by using your new set id and password now.