Install and configure JDKTomcatMySQL in Ubuntu12.04

Source: Internet
Author: User
1. When the Ubuntu12.04 system is installed, the root user is disabled. Set the allocation: sudopasswd, and then specify the corresponding password. Suroot: Enter the new password *** to log on to the root user. 2. method 1 for setting jdk environment variables in linux # vi/etc/profile Add the following content at the end: # setjavaenvironment & nb

1. When Ubuntu 12.04 is first installed: the root user is disabled, set the assignment to sudo passwd, and then specify the corresponding password. Su root, input
The new password *** can be used to log on to the root user.

2. Set jdk environment variables in linux
Method 1,
# Vi/etc/profile
Add the following content at the end:
# Set java environment
Export JAVA_HOME =/usr/lib/java/jdk1.7.0 _ 03
Export CLASSPATH =.; $ CLASSPATH: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Export JRE_HOME = $ JAVA_HOME/jre
Save and exit
# Source/etc/profile # make it take effect
# Set
Method 2: All users can use
Vi/etc/profile. d/java. sh
Add the following content to new java. sh:
# Set java environment
JAVA_HOME =/usr/lib/java/jdk1.7.0 _ 03
CLASSPATH =.; $ JAVA_HOME/lib/tools. jar
Save and exit
Assign permissions to java. sh: chmod 755/etc/profile. d/java. sh
====== Below can be tested ======
# Echo $ JAVA_HOME
# Echo $ PATH
Check whether JDK is successful
# Java-version

3. Set Tomcat environment variables in linux
A. Configure the server code URIEncoding = "UTF-8" or URIEncoding = "GBK" as much as possible to be consistent with the project code
B. Add export TOMCAT_HOME =/usr/lib/server/apache-tomcat-7.0.27
C. Add admin user, add in tomcat-users.xml

4. decompress the archive
Tar-zxvf jdk-7u3-linux-i586.tar.gz
Tar-xvf jdk-7u3-linux-i586.tar

5. Modify the default file user
Chown shefron MySQL-5.5.rpm other chmod, chgrp

6. Ubuntu MySQL built-in and Installation
A. apt-get install mysql-server

7. Access denied for the root user in MySQL
A. #/etc/init. d/mysql stop
B. # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking &
C. # mysql-u root mysql
D. mysql> flush privileges;
E. mysql> quit
F. #/etc/init. d/mysql restart
G. # mysql-u root-p
Enter password:

8. login and exit of MySQL users
A. # mysql-u root-p
B. # Enter password
C. mysql> quit or [Ctrl + D]

9. Create a database in MySQL and grant the database user permissions to new users.
A. mysql> create database shop;
B. mysql> grant all privileges on shop. * to shop_user @ localhost identified by "123456 ";
If you want remote access or control, you can:
1. mysql> grant all privileges on shop. * shop_user @ "%" identified by "654321 ";
Ii. vi/etc/mysql/my. cnf
Bind-address = (Server IP)
Restart the MySQL server:/etc/init. d/mysql restart

10. MySQL database encoding settings
A. Find the my. cnf file (/etc/my. cnf or/etc/mysql/my. cnf)
B. Add default-character-set = utf8 under [client] or [mysqld] to save and exit

For more information about Ubuntu, see Ubuntu special page Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.