Install and deploy java8 and mysql in centos7, and centos7java8
Generally, both java and deployment projects are deployed locally, but the production environment is generally in the linux environment. The deployment and installation environments are all operated on the console, there is no visual operation interface for windows. It is a challenge for Tom to master and operate linux commands. Record the installation and configuration process so that he can learn with everyone:
Log on to the remote server. for personal use, the root account is used. enter your password.
ssh -i ~/.ssh/id_rsa root@ip
Install Java 8
My server has yum, so most of the things are installed using yum, similar to homebrew on mac OS. The installation configuration is relatively simple.
First, let's take a look at the java versions in yum:
yum -y list java*
After that, you can see a series of java1.6, 1.7, and 1.8. You can choose the version you want to install. I installed 1.8 on myself:
yum -y install java-1.8.0-openjdk*
The process is smooth and a prompt is displayed!
Next, verify the java version to see if the installation is complete:
java -versionopenjdk version "1.8.0_121"OpenJDK Runtime Environment (build 1.8.0_121-b13)OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
Okay. At this time, we have installed Java 8 successfully! Next, install mysql:
Install mysql
First download the installation package. This process depends on the network speed of your server:
Wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Then install the mysql package:
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
After the installation, you can install mysql:
sudo yum install mysql-server
All the way to y is y ~
I lost my way as I walked through the online tutorial and thought the installation was complete,
Start service first:
service mysqld start
Elegant preparationmysql -u root -p
Change the password. What about the initial password? Okay. The online tutorials are as follows:
grep "password" /var/log/mysqld.log
But I did not find it!
What should I do?
Modify in security mode:
mysqld_safe --skip-grant-tables &
Next, we continue to mysql-u root-p without entering the password and press Enter! Change Password
1. Change the password
Update mysql. user set authentication_string = password ('your password') where user = 'root' and Host = 'localhost ';
2. Refresh Permissions
flush privileges;
3. Exit
quit
Restart the mysql service after exiting:
service mysqld restart
Then
mysql -u root -p
Enter your password!
Redis, zookeeper, and tomcat may be installed later.
The above section describes how to install and deploy Java 8 and mysql in centos7. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!