How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511

This article describes the method of installing jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511. Share with you for your reference, as follows:

One: Environment

Two: Download the jdk rpm package to the local and upload it to the server (because I just started using wget to download it directly to the server, and the installation kept reporting errors, so I decided to use this stupid method)

Download link: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm

JDK is installed by default in /usr/java

Three: Configure environment variables

After installing jdk-8u151-linux-x64.rpm on my machine, the java -version operation can be performed normally without configuring environment variables, so I did not configure the JDK environment variables. But for future discomforts, here is how to configure it. The operation is 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:

CLASSPATH=.:JAVAHOME/lib/dt.jar:JAVA_HOME/lib/tools.jar:

Make changes take effect

[ root@localhost ~]# source /etc/profile  //Make changes take effect immediately[root@localhost ~]#echo $PATH  //View PATH value

View 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

After the installation is successful, restart the mysql service.

# service mysqld restart

When mysql is installed for the first time, the root account has no 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 encoding 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 of all tables in all databases to the root user 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';

At this point, you can connect remotely.

Hope this article will help you maintain CentOS server.

Recommended Posts

How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install offline JDK1.8 on centos7.0
How to install JDK and Mysql on Ubuntu 18.04 linux system
How to install and configure Elasticsearch on CentOS 7
How to install and configure VNC on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
How to install MySQL on Ubuntu 20.04
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install MySQL on Ubuntu 20.04
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install MySQL on Ubuntu 14.04
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install and configure NFS server on CentOS 8
How to install and use Cockpit on CentOS 8/RHEL 8
How to install and configure Postfix mail server on CentOS8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
How to install MySQL on Ubuntu 18.04 (linux)
[Graphic] How to install tomcat on centos