Home > Article > Operation and Maintenance > Centos7.2.1511 installation jdk1.8.0_151 and mysql5.6.38 tutorial
This article mainly introduces the method of installing jdk1.8.0_151 and mysql5.6.38 in centos7.2.1511. It describes the specific steps and related setting skills of installing jdk1.8.0_151 and mysql5.6.38 in centos7.2.1511 in more detail. Friends who need it You can refer to it, I hope it can help everyone.
The example in this article describes how to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511. Share it with everyone for your reference, the details are as follows:
1: Environment
2: Download the jdk rpm package locally and upload it to the server (because this I just started using wget to download directly to the server, and the installation kept 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 3: Configure environment variablesAfter installing jdk-8u151-linux-x64.rpm on my machine, I can perform the java –version operation normally without configuring environment variables, so I did not configure the JDK environment. Configuration of variables. But for the sake of future discomfort, here is a record of how to configure it. The operation is as follows:vi /etc/profileAppend the following content to the file:
JAVA_HOME=/usr/java/jdk1.8.0_151JRE_HOME=/usr/java/jdk1.8.0_151/jrePATH=$PATH:$JAVA_HOME/bin:$ JRE_HOME/binCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATHMake changes effective
[root@localhost ~]# source /etc/profile //使修改立即生效 [root@localhost ~]#echo $PATH //查看PATH值Check the system environment status
[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/binFour: Install mysql (download and install mysql-server from 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-serverRestart the mysql service after successful installation.
# service mysqld restartWhen installing mysql for the first time, the 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 mysql1. EncodingThe mysql configuration file is /etc/my.cnf Finally, add the encoding configuration
[mysql] default-character-set =utf8The character encoding here must be consistent with /usr/share/mysql/charsets/Index.xml. 2. Remote connection settingsAssign all permissions on all tables in all databases to the root user located at all IP addresses.
mysql> grant all privileges on *.* to root@'%'identified by 'password';If it is a new user instead of root, you must first create a new user
mysql>create user 'username'@'%' identified by 'password';Then you can connect remotely. Related recommendations:
Centos7.3 installation mysql5.7.18 rpm tutorial
Linux CentOS MySQL database installation and configuration example sharing
Share graphic tutorials on the installation and configuration method of mysql5.7.18 under centos6.4
The above is the detailed content of Centos7.2.1511 installation jdk1.8.0_151 and mysql5.6.38 tutorial. For more information, please follow other related articles on the PHP Chinese website!