To operate a remote Linux server prepare:
1, download FileZilla used to upload files to the Linux system
2. Download Putty Linux System Operation window
Installing the JDK
1. Check your Linux bits first:
Uname-a;
Download the corresponding JDK on the official website
2. Upload the downloaded JDK to the Linux system with FileZilla
3. Switch to the directory where the JDK is located using putty
To Operation Permissions CHOMD 777 [JDK file name]
Install:./[jdk file Name]
Installing Tomcat
1) Download apache-tomcat-6.0.10.tar.gz
2) #tar-ZXVF apache-tomcat-6.0.10.tar.gz;//Unzip
3) #cp-R apache-tomcat-6.0.10/usr/local/tomcat;//Copy apache-tomcat-6.0.10 to/usr/local/and rename to Tomcat
4)/usr/local/tomcat/bin/startup.sh;//Start Tomcat
Display Using catalina_base:/usr/local/tomcat
Using Catalina_home:/usr/local/tomcat
Using Catalina_temdir:/usr/local/tomcat/temp
Using Java_home:/usr/java/jdk1.6.0_01
To this tomcat has been installed to complete,
Install MySQL
View System version command: LSB_RELEASE-A
online installation via Yum commandMySQL
Online installation command: Yum Install (single installation) Yum Install–y (multiple installations)
For example:
Yum Install Mysql-server
Yum install–y mysql-server MySQL Mysql-deve
how to turn on, turn off, and restart the MySQL service command
initiator -1:service mysql start
start mode 2:/etc/init.d/mysql start
start mode 3:service mysqld Start
start mode 4:/etc/init.d/ Mysqld start
< br> stop mode 1:service mysql stop
stop mode 2:/etc/init.d/mysql Shutdown
stop mode 3:service mysqld stop
Stop mode 4:/etc/init.d/mysqld shutdown
Restart mode 1:service mysql restart
Restart Mode 2:/etc/init.d/mysql Restart
Restart mode 3:service mysqld restart
Restart Mode 4:/etc/init.d/mysqld Restart
Connect to MySQL
Syntax: mysql-u user name-p user password (MySQL installation initial password is empty)
Exit Mql:exit;
Change Password:
Mysqladmin-u root-p Password "111"
manipulating databases
Log in to MySQL, and then run the following command at the prompt of MySQL, with each command ending with a semicolon.
1. Display the list of databases.
show databases;
The default is two databases: MySQL and test. MySQL inventory in the MySQL system and user rights information, we change the password and the new user, is actually to operate the library.
2. Display the data table in the library:
Use MySQL;
Show tables;
3, display the structure of the data table:
describe table name;
4. Build the library and delete the library:
Create database name;
drop database name;
5, build the table:
Use library name;
CREATE TABLE table name (field list);
drop table name;
6. Clear the Table records:
Delete from table name;
7. Display the records in the table:
SELECT * from table name;
Exporting and importing data
1. Export Data:
Mysqldump--opt Test > Mysql.test
Export the database test database to the Mysql.test file, which is a text file
such as: Mysqldump-u root-p123456--databases dbname >mysql.dbname
is to export the database dbname to the file mysql.dbname.
2. Import data:
Mysqlimport-u root-p123456 < Mysql.dbname.
You don't have to explain.
3. Import text data into the database:
The field data of the text data is separated by the TAB key.
Use test;
Load data local infile "file name" into table name;
1: Use the show statement to find out what database currently exists on the server:
Mysql> SHOW DATABASES;
2:2. Create a database Mysqldata
mysql> CREATE DATABASE Mysqldata;
3: Select the database you created
mysql> use Mysqldata; (press ENTER to appear database changed the operation is successful!) )
4: See what tables exist in the current database
Mysql> SHOW TABLES;
5: Create a database table
Mysql> CREATE TABLE MYTABLE (name VARCHAR), Sexchar (1));
6: Show the structure of the table:
Mysql> DESCRIBE MYTABLE;
7: Add a record to the table
mysql> INSERT INTO MYTABLE values ("HyQ", "M");
8: Loading data into a database table in text mode (for example, D:/mysql.txt)
mysql> LOAD DATA LOCAL INFILE "D:/mysql.txt" intotable MYTABLE;
9: Import. sql File command (for example, D:/mysql.sql)
Mysql>use database;
Mysql>source D:/mysql.sql;
10: Delete Table
Mysql>drop TABLE MYTABLE;
11: Clear the table
Mysql>delete from MYTABLE;
12: Update data in table
Mysql>update MYTABLE set sex= "F" where name= ' HyQ '; 13: Back Up the database mysqldump-u root library name >XXX.DATA14:
Example 2: Connecting to MySQL on a remote host
Assume the remote host IP is: 110.110.110.110, the user name is root, the password is abcd123. Type the following command:
Mysql-h110.110.110.110-uroot-pabcd123
(Note: You and root can be used without spaces, others are the same)
3. Exit MySQL command: Exit
Linux JDK + tomcat+mysql installation