The download address: jdk1.8
┌─[root@nedrain]─[/usr/java]
└──? $ls
jdk1.8.0_251 jdk-8u251-linux-x64.tar.gz
vim /etc/profile
//add these lines at the bottom
#jdk
export JAVA_HOME=/usr/java/jdk1.8.0_251
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
// source the file
source /etc/profile
┌─[root@nedrain]─[/usr/java]
└──? $java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
┌─[root@mycentos]─[~]
└──? $systemctl start mysqld.service // start
┌─[root@mycentos]─[~]
└──? $systemctl status mysqld.service // check it
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-06-19 05:43:28 EDT; 11s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 16071 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 16022 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 16074 (mysqld)
CGroup: /system.slice/mysqld.service
└─16074 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/my...
Jun 19 05:43:23 mycentos systemd[1]: Starting MySQL Server...
Jun 19 05:43:28 mycentos systemd[1]: Started MySQL Server.
grep "password" /var/log/mysqld.log
// you will see
┌─[root@mycentos]─[~]
└──? $grep "password" /var/log/mysqld.log
2020-06-19T09:43:24.809876Z 1 [Note] A temporary password is generated for root@localhost: VrI3RStYm#j;
vim /etc/my.cnf
// and this line at the bottom
skip-grant-tables=1
//then restart the mysql service
systemctl restart mysqld.service
// log in without password
mysql -u root
// choose database "mysql"
use mysql;
// update table "user"
update user set authentication_string = password(‘***************‘)where user=‘root‘;
//then exit mysql and delete that line in /etc/my.cnf
vim /etc/my.cnf
//restart the service
systemctl restart mysqld.service
// do it
mysql -u root -p
┌─[root@mycentos]─[~]
└──? $mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.30
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql> exit;
Bye
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘new password‘;
yum -y remove mysql57-community-release-el7-10.noarch
┌─[root@nedrain]─[/usr/tomcat]
└──? $ls
apache-tomcat-8.5.56 apache-tomcat-8.5.56.tar.gz
原文:https://www.cnblogs.com/nedrain/p/13164473.html