ubuntu server version install Java environment mysql environment

1 Download jdk first. I downloaded it locally and uploaded it to Ubuntu.
Insert picture description here
2 Unzip

chen@chenserver:~/java$ tar -zvxf  jdk-8u162-linux-x64.tar.gz  #—C 路径 解压到指定路径 

3 Move the decompressed file to /usr/java

chen@chenserver:~/java$  mv jdk1.8.0_60 /usr/java/java8

4 Configure environment files

vi ~/.bashrc

Add the following code

export JAVA_HOME=/usr/java/java8  #这个路径是java 的位置
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

5 Make the configuration file effective

source ~/.bashrc

6 Use java -version to see if java is successfully installed, the following figure shows the output of successful installation
Insert picture description here

Install mysql ubuntu is 20.04.4 mysql is 8.0.21-0ubuntu0.20.04.4 (Ubuntu)

# 命令安装
sudo apt-get update
sudo apt-get install -y mysql-server mysql-client
 
# 进入mysql命令行
mysql -udebian-sys-maint -p
# 输入/etc/mysql/debian.cnf中的password
 
# 修改密码
use mysql;
update user set authentication_string='密码' where user='root';
FLUSH PRIVILEGES;

Guess you like

Origin blog.csdn.net/NewDay_/article/details/108950028