ubuntu10 myql+tomcat+jdk安装

ubuntu10 myql+tomcat+jdk安装

一、JDK安装配置
1、安装java6
在新得立软件里没有,需要设置,参考http://blog.sina.com.cn/s/blog_473f94590100m6hb.html
sudo apt-get install sun-java6-jdk
2、选择默认 java
sudo update-alternatives --config java
3、配置环境变量:
sudo gedit /etc/environment
在其中添加如下两行:
CLASSPATH=/usr/lib/jvm/java-6-sun/lib
JAVA_HOME=/usr/lib/jvm/java-6-sun
保存退出

二、安装TomCat1、下载在http://tomcat.apache.org/download-60.cgi#6.0.14下载最新的版本:6.0.14 sudo tar zxvf MyDownloads/apache-tomcat-6.0.14.tar.gz sudo cp -R apache-tomcat-6.0.14  /opt/apache-tomcat-6.0.142、环境变量Tomcat需要设置JAVA_HOME或者JRE_HOME的环境变量后才能正常运行。打开配置文件: sudo gedit ~/.bashrc 在文件的末尾,添加如下两行export JAVA_HOME=/usr/lib/jvm/java-6-sunexport PATH=$PATH:$JAVA_HOME/bin

三、安装mysql
安装步骤:

       命令如下:
apt-get install mysql-server
apt-get install mysql-client
安装时,会提示你设定root密码

重复密码:


部署步骤:

       设置 mysql root 访问密码:

mysqladmin -uroot password <password>

启动 mysql 服务
   /etc/init.d/mysql start 或 service mysql start
停止 mysql 服务 
   /etc/init.d/mysql stop 或 service mysql stop

重启 mysql 服务 
   /etc/init.d/mysql restart 或 service mysql restart


进入 mysql 数据库 
mysql -uroot –p
根据提示输入 root 访问密码 , 显示如下信息,表明可以开始 mysql 操作:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.50-community-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

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

mysql>

       ubuntu10.4系统中不需要设置mysql自启动,安装时候已经作为service。
       所以一启动ubuntu系统,mysql服务自动启动。


转载   http://blog.sina.com.cn/s/blog_473f94590100m6hk.html

猜你喜欢

转载自googlers.iteye.com/blog/867903
今日推荐