The method of installing jdk1.8.0_151 and mysql5.6.38 in centos7.2.1511
This paper gives an example of how to install jdk1.8.0_151 and mysql5.6.38 in centos7.2.1511. Share with you for your reference, the details are as follows:
One: environment
Second: download the rpm package of jdk locally and upload it to the server (because I just started to use wget to download directly to the server, and the installation keeps reporting errors, so I decided to use this stupid method)
Download address: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm
JDK is installed in / usr/java by default
Three: configure environment variables
My machine can perform java-version operations normally without configuring environment variables after installing jdk-8u151-linux-x64.rpm, so I did not configure JDK environment variables. However, for future discomfort, here is a record of how to configure it, as follows:
Modify the system environment variable file
Vi / etc/profile
Append the following to the file:
JAVA_HOME=/usr/java/jdk1.8.0_151
JRE_HOME=/usr/java/jdk1.8.0_151/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATH
Make the changes effective
[root@localhost ~] # source / etc/profile / / make the modification take effect immediately [root@localhost ~] # echo $PATH / / View path value
View the status of the system environment
[root@localhost ~] # echo $PATH/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.8.0_25/bin:/usr/java/jdk1.8.0_25/jre/bin
4: install mysql (download and install mysql-server on the official website)
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm# rpm-ivh mysql-community-release-el7-5.noarch.rpm# yum install mysql-community-server
Restart the mysql service after successful installation.
# service mysqld restart
The initial installation of the mysql,root account does not have a password.
Set password
Mysql > set password for 'root'@'localhost' = password (' password'); Query OK, 0 rows affected (0.00 sec) mysql >
Five: configure mysql
1. Coding
The mysql configuration file is / etc/my.cnf
Finally, add the coding configuration.
[mysql] default-character-set = utf8
The character encoding here must be the same as in / usr/share/mysql/charsets/Index.xml.
2. Remote connection settings
Assign all permissions on all tables in all databases to root users at all IP addresses.
Mysql > grant all privileges on *. * to root@'%'identified by 'password'
If it is a new user instead of root, create a new user first
Mysql > create user 'username'@'%' identified by' password'
At this point, you can connect remotely.
I hope what is described in this article will be helpful to the maintenance of CentOS server.