CentOS-6.3安装配置JDK-8

JAVA_HOME=/usr/java/jdk1.8.0_45
JRE_HOME=/usr/java/jdk1.8.0_45/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 
 
[root@admin local]# source /etc/profile   //使修改立即生效
[root@admin local]#        echo $PATH   //查看PATH值 

[root@admin ~]# echo $PATH
/usr/local/cmake/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0/bin:/usr/java/jdk1.7.0/jre/bin:/root/bin 
 
登录MySQL

mysql -uroot -p
如果无法登录可以使用find / -name mysql搜索mysql程序的路径,比如mysql程序路径为:/usr/local/mysql/bin/mysql,我们可以这样登录:

/usr/local/mysql/bin/mysql -uroot -p
执行如下命令:

grant all privileges on *.* to 'root'@'%' identified by 'ROOT-PASSWORD'; 
flush privileges; exit
 

你可能感兴趣的:(centos)