1, upload the required documents (prepared in advance where the installation package jdk and tomcat, mysql need to install online)
jdk installation package name: jdk-8u151-linux-x64.tar.gz
Name of installation package tomcat: apache-tomcat-8.5.15.tar.gz
2, jdk installation:
Check for and uninstall centos jdk that comes with the jdk:
1, first check centos comes with jdk: rpm -qa | grep java
2, uninstall centos comes with jdk: rpm -e --nodeps centos jdk that comes with the name of (1 through check out, check out a few unload a few)
3, completed and then uninstall command 1 check whether I have uninstalled clean.
Installation:
our jdk uploaded to the / usr / local / src directory; unpack: tar -zxvf xxxx.tar.gz -C /usr/local/jdk1.8(jdk1.8 This directory is created yourself)
Note: - C represents the absolute current directory.
Configuring environment variables:
vi / etc / Profile ==> Open the file: Add two sentences:
Export JAVA_HOME = / usr / local / jdk1.8 / jdk1.8.0_151
Export the PATH = $ JAVA_HOME / bin: $ the PATH
allow configuration file to take effect:
Source / etc / Profile
check jdk whether the ok:
the Java -version
3, tomcat installation:
New local directory under a tomcat directory, then unzip tomcat in the directory can be used without an environmental variable configuration.
4, mysql-line installation:
(1) uninstall mysql
Check on whether the operating system is already installed mysql database
rpm -qa |grep mysql
See the newly installed version of mysql-server
rpm -qi mysql-server
Uninstall the original mysql
rpm -e mysql // delete common mode
rpm -e --nodeps mysql // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
(2)在线安装mysql: yum install -y mysql-server mysql mysql-deve
启动:service mysqld restart
设置密码:
mysqladmin -u root password 'root'
测试:
mysql -uroot -p测试
开机自启动:
查看是否已设置
chkconfig --list | grep mysqld
设置开机自启动
chkconfig mysqld on
查看是否已设置
chkconfig --list | grep mysqld
字符集的修改:
登录mysql:
然后输入命令查看mysql的字符集:show variables like 'character%';
修改:先退出mysql :exit; 然后输入命令: vi /etc/my.cnf 打开文件,然后在里面添加以下标红语句:
[client]
default-character-set=utf8
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default-character-set=utf8
init_connect='SET NAMES utf8'
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
重启服务:
service mysqld restart
然后通过查看字符集命令进行验证