1. rpm -ivh jdk-7-linux-x64.rpm
2. vi + /etc/profile
增加:
JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
3.使修改生效
source /etc/profile //使修改立即生效
echo $PATH //查看PATH值
Ubuntu:
<span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> lrzsz
<span class="token function">sudo</span> <span class="token function">tar</span> -zxvf jdk-8u371-linux-x64.tar.gz
<span class="token function">vim</span> ~/.bashrc
export JAVA_HOME=/root/jdk/jdk1.8.0_371
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
Esc键,:wq! 保存并退出。
<span class="token builtin class-name">source</span> ~/.bashrc
-----------------------
4.Mysql远程:
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
flush privileges;
8.0以上
create user root@'%' identified by '123456';
grant all privileges on *.* to 'root'@'%';
flush privileges;
5.数据库优化:
#lower_case_table_names=1 #8.0以下
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION