Home  >  Article  >  Operation and Maintenance  >  Centos7.2.1511 installation jdk1.8.0_151 and mysql5.6.38 tutorial

Centos7.2.1511 installation jdk1.8.0_151 and mysql5.6.38 tutorial

小云云
小云云Original
2018-01-20 09:28:502493browse

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 variables

After 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:


Modify the system environment variable file

vi  /etc/profile
Append the following content 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 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/bin
Four: 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-server
Restart the mysql service after successful installation.

# service mysqld restart
When 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 mysql

1. Encoding

The mysql configuration file is /etc/my.cnf

Finally, add the encoding configuration

[mysql]
default-character-set =utf8
The character encoding here must be consistent with /usr/share/mysql/charsets/Index.xml.

2. Remote connection settings

Assign 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn