Install JDK & Java & eclipse & MySQL on mongown

Source: Internet
Author: User
Tags mysql commands

Installation steps:

I. InstallationJDK

1. First download JDK 5.0 (JDK 5.0 download page: http://java.sun.com/j2se/1.5.0/download.jsp );

2. Run the JDK 5.0installer jdk-rj5_0_06-windows-i586-p.exe. All the options remain the default value during installation;

3. Finally, configure the JDK environment variable: Right-click "my computer" and choose "properties"> "advanced"> "environment variable (n )".

 

Create a system variable java_home: C: \ Program Files \ Java \ jdk1.5.0 _ 06;

New system variable classpath:.; % java_home % \ Lib; (Note: The dot number indicates the current directory and cannot be omitted)

Add the following content before the system variable PATH value: % java_home % \ bin; (Note: The semicolon here cannot be omitted)

4. JDK installation is complete.

Next we will test whether JDK is successfully installed:

Copy the following content to notepad:

Public class hellojava {

Public static void main (string SRG []) {

System. Out. println ("Hello Java! ");

}

}

Save it as "hellojava. Java" (without quotation marks, the same below) and save it to the root directory of drive D. Enter the commands marked by the red line in the command line in sequence:

If the content marked in the red box appears, the JDK is successfully installed!
Note: If you want to install integrated development environments such as Eclipse, Borland JBuilder, jcreator, and intellij idea (IDE, integrated development environment) in the future, compile and run a simple helloworld program in the IDE, to ensure that the IDE can identify the JDK location.

 

Ii. InstallationTomcat

The download page for idea is: http://apache.linuxforum.net/tomcat/tomcat-5/v5.0.30/bin)

2. Unzip jakarta-tomcat-5.0.30.zip to the root directory of drive D.

 

3. Finally, configure the Tomcat environment variable: Right-click "my computer" and choose "properties"> "advanced"> "environment variable (n )".

New system variable catalina_home: D: \ jakarta-tomcat-5.0.30

Add % catalina_home % \ common \ Lib to the value of the system variable classpath;

Add the following content to the path value of the system variable "% java_home % \ bin;": % catalina_home % \ bin;

At this point, tomcat installation is complete.

 

After completing step 1 and step 2, the values of the system variables are as follows:

Java_home: C: \ Program Files \ Java \ jdk1.5.0 _ 06

Catalina_home: D: \ jakarta-tomcat-5.0.30

Classpath:.; % java_home % \ Lib; % catalina_home % \ common \ Lib;

Path: % java_home % \ bin; % catalina_home % \ bin; % SystemRoot % \ system32; % SystemRoot % \ system32 \ WBEM

Iii. InstallationMyEclipse(IfMyeclipseNot includedEclipseFirst installEclipse)

1. First download myeclipse (: http: // downloads.MyeclipseBytes

Crack File Download: http://d.download.csdn.net/down/2190752/dfg727)

2. After installing myeclipse, open a new project,

 

 

 

3. Create a JSP page

4. Configure Tomcat menu windows -- preferences

 

 

5. Deploy (deployment) project

 

 

6. Start the Tomcat server

 

 

7. Run the website

 

Note: additional project creation practices

Although JSP files can be created using the above method, this method cannot automatically contain some class libraries in Tomcat, which may cause a lot of trouble after the project is deployed. Therefore, we recommend that you use the following method to create a project:

(1) In eclipse, perform the following operations: Eclipse> File> New> Project>. In the displayed window, select Java> Tomcat project to create a new project;

(2) after the project is created, right-click the project name in package Development E and choose myeclipse> Add webproject capabilities from the shortcut menu (as shown in ); after being added to this function, you can develop various web applications;

 

 

V. Install MySQL

1. Download mysql-noinstall-5.1.45-win32.zip;

2. Assume that the package is decompressed in c: \ Program Files \ mysql. There is a "data" directory under this Directory, which is the place where the data is stored. To facilitate backup

And upgrade, it is best to put it elsewhere;

3. Compile the configuration file

First, let's take a look at the MySQL root directory, which contains multiple files in the form of my-***. ini. This is the MySQL configuration.

You can select one of the copies to change its name to my. INI and copy it to C: \ WINDOWS. when MySQL is started, it reads this my. the INI file determines the database parameters.

In the my. ini file, you need to configure the client and server.

* Client Configuration
#-----------------------------------------------------
[Winmysqladmin]
Server = "C:/program files/MySQL/bin/mysqld-net.exe"
User = root
Password = *********

[Client]
User = root
# Password = *********
Port = 3306

[MySQL]
Default-character-set = GBK

* Server Configuration

[Mysqld]
Basedir = "C:/program files/MySQL"
Datadir = "C:/program files/MySQL/Data"
Default-character-set = GBK
Default-storage-engine = InnoDB
Max_connections = 100
Max_allowed_packet = 16 m

 

3. Start the MySQL database

* You can add c: \ Program Files \ mysql \ bin in the path of the Windows environment variable so that we can

You can directly use MySQL commands in the command line.
* In addition, We can register a database as a service and start it as the system starts. The specific command is as follows:

Cd c: \ Program Files \ mysql \ bin

Mysqld-install

After running the preceding command, a service named MySQL and Automatic startup will be registered in the system service.

By default, this service is automatically started.

You can use the command line to prevent the service from being stopped or started, for example:

Net start MySQL startup)
Net stop MySQL (STOP)
Mysqld -- remove MySQL (uninstall service)

4. Use the MySQL database

* Because we add bin in the MySQL installation directory to the path of the environment variable, we can directly use MySQL

.

* After the above information is configured and MySQL is started, the default user name is root, and the password is blank, so we can use

To log on to the database:
  
C: \ mysql-uroot-hlocalhost

After you press enter, the following command line status will be displayed:

Mysql>

This indicates that you have successfully logged on to the MySQL database.

If you want to add a password to the root user, you can exit mysql> quit, and then use the following command to set the root user's

Password:

C: \ mysqladmin-uroot password 123456

In this way, the password of the root user is changed to 123456. The following code is required to log on to the database again:

C: \ mysql-uroot-p123456-hlocalhost

So far, the configuration of the mysql5 database is complete. You can use the database through the client or program.

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: info-contact@alibabacloud.com 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.