Linux install JDK MySQL Tomcat

Source: Internet
Author: User

MySQL installation goes to MySQL website

Click Archives

Select version Download tar

Linux installation MySQL database--tar.gz Package Decompression installation method

MySQL database has a variety of installation methods, this article only describes the Linux server tar.gz package decompression installation method,

Download mysql-5.7.3-m13-linux-glibc2.5-x86_64.tar.gz (suffix tar.gz compiled installation file) via MySQL website or network resources first.
1. First new MySQL user # Useradd MySQL and set disable MySQL login service permissions # usermod-s/sbin/nologin MySQL
2, will download the tar.gz file through Xftp (or other tools to upload the server to install)
3. Create a new folder in the # cd usr/local/directory (mysqlservice) # mkdir Mysqlservice
4. Go back to the uploaded directory and move the tar.gz file to the # CD Usr/local/mysqlservice

# Cp-r Mysql-5.7.3-m13-linux-glibc2.5-x86_64.tar.gz/usr/local/mysqlservice/mysql-5.7.3-m13-linux-glibc2.5-x86_ 64.tar.gz
5, Decompression command format: TAR-ZXVF compressed file name. tar.gz # TAR-ZXVF Apache-tomcat-7.0.64.tar.gz
6. Modify the file name [[email protected] mysqlservice]# mv mysql-5.7.3-m13-linux-glibc2.5-x86_64 MySQL

7. Add MySQL group and MySQL user to set the MySQL installation directory file owner and owning group.
[[email protected] mysqlservice]# Groupadd MySQL
[[email protected] mysqlservice]# useradd-r-g MySQL MySQL

9. Go to the MySQL folder, which is the directory where MySQL resides, and change the group and user to which it belongs.


10, [[email protected] mysql]# chown-r mysql:mysql.

Check the current directory is what is not in the compiled installation of the MySQL program directory, in the directory there is no next scripts, and then check under the scripts/directory there is no mysql_install_db this file, there is no permission to execute this file
[Email protected] mysql]#/scripts/mysql_install_db--user=mysql

11. Change the owner of the file and directory under the current directory to the root user.
[Email protected] mysql]# chown-r root:root.

Change the owner of the Mysql_data folder to the MySQL user.
[Email protected] mysql]# chown-r mysql:mysql data
Cope the configuration file to the/etc/init.d/directory
[email protected] mysql]# CP Support-files/mysql.server/etc/init.d/mysql

Create a new Log/mysqld.log directory under the installation directory

12, modify the configuration file [[email protected] mysql]# VIM/ETC/MY.CNF
[Client]
Default-character-set=utf8

[Mysqld]
Character-set-server=utf8
Datadir=/usr/local/mysqlservice/mysql/data
Basedir=/usr/local/mysqlservice/mysql
Socket=/tmp/mysql.sock

[Mysqld_safe]
Log-error=/usr/local/mysqlservice/mysql/log/mysqld.log

13. Check if the relevant file directory has sufficient permissions
# LL
Assign permissions to the required files if you do not have permission
# chmod-r 755 Mysqld.log
14. Start the MySQL service

[[Email protected] mysql]# service MySQL start
Stop MySQL Service
[[Email protected] mysql]# service MySQL stop

15. View the service process
[[email protected] mysql]# ps-ef|grep MySQL
View MySQL Logs
[Email protected] mysql]# VI log/mysqld.log

16. Modify the password of the root user of MySQL and open the remote connection
[[email protected] mysql]# mysql-u root MySQL

mysql> use MySQL;
mysql> desc User;
Mysql> GRANT All privileges on * * to [email protected] '% ' identified by ' root '; The ability to add remote connections for root
mysql> Update user Set Password = Password (' 123456 ') where user= ' root '; Set the root user password
Mysql> Select Host,user,password from User where user= ' root ';
mysql> flush Privileges;
Mysql> exit

Re-Login
[Email protected] mysql]# mysql-u root-p
Enter password:123456

If you are not able to connect remotely, turn off the firewall
[[Email protected]]#/etc/rc.d/init.d/iptables Stop



Uninstall MySQL

1, RPM-QA | Grep-i MySQL
2, Rpm-e mysql-libs-5.1.61-4.el6.x86_64--nodeps
3. RM-RF MySQL Folder

Installing the JDK


1. Log in to Linux and switch to the root user



Su Root gets root user rights, the current working directory is unchanged (requires root password)


Or


Sudo-i does not require the root password to switch directly to root (requires the current user password)


2. Create the Java installation directory in the USR directory



Cd/usr


mkdir Java


3. Copy the jdk-8u60-linux-x64.tar.gz to the Java directory



cp/mnt/hgfs/linux/jdk-8u60-linux-x64.tar.gz/usr/java/


4. Unzip the JDK to the current directory



TAR-ZXVF jdk-8u60-linux-x64.tar.gz


Get folder jdk1.8.0_60


5. Installation completed for him to create a link to save the directory length


(I don't use this step)
Ln-s/usr/java/jdk1.8.0_60//USR/JDK


6. Edit the configuration file, configure environment variables



Vim/etc/profile


Add the following: Java_home according to the actual directory to
Java_home=/usr/java/jdk1.8.0_60
Classpath= $JAVA _home/lib/
Path= $PATH: $JAVA _home/bin
Export PATH java_home CLASSPATH




7. Restart the machine or execute the command: Source/etc/profile



sudo shutdown-r now


8. View installation Status

Java-version


Java Version "1.8.0_60"
Java (TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot (TM) Client VM (build 25.60-b23, Mixed mode)




Error messages that may appear:



BASH:./java:cannot Execute binary file


This error can occur because a 64-bit JDK is installed on a 32-bit operating system,
See if the JDK version and Linux version are the same number of bits.
To see if your Ubuntu installation is a 32-bit or 64-bit system:
sudo uname--m
i686//indicates 32-bit
x86_64//indicates 64-bit

Linux install JDK MySQL Tomcat

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.