一、JDK安装
1、通过xftp工具把jdk-8u60-linux-x64.gz上传到linux
2、解压JDK命令tar -xzf jdk-8u60-linux-x64.gz
3、linux配置环境变量vi /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_60
JRE_HOME=/usr/local/java/jdk1.8.0_60/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保存并退出
export JAVA_HOME=/usr/local/java/jdk1.8.0_60
export PATH=$PATH:$JAVA_HOME/binexport JAVA_HOME=/usr/local/jdk1.8.0_77
export PATH=$PATH:$JAVA_HOME/bin二、Mysql安装
0、通过xftp工具把MySQL-5.6.26-1.linux_glibc2.5.x86_64.rpm-bundle.tar上传到linux
解压[root@localhost ~]# tar -xvf MySQL-5.6.26-1.linux_glibc2.5.x86_64.rpm-bundle.tar
1、先删除系统中自带的残存的mysql库
rpm -qa |grep mysql #查看系统中已有的mysql相关的库
rpm -e mysql-libs-5.1.66-2.el6_3.i686 --nodeps #删除老的库
rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm #安装mysql服务器
rpm -ivh MySQK-client5.1.73-1.glibc23.i386.rpm #安装mysql客户端
2、安装好之后会在root下有个隐藏文件.mysql_secret有root随机密码
查询隐藏文件
[root@localhost ~]# cat ./.mysql_secret
# The random password set for the root user at Tue May 24 19:33:13 2016 (local time): eGNEvAgTNn4vdLJw
3、启动mysql服务
[root@localhost ~]# service mysql start
Starting MySQL.... SUCCESS!4、登录mysql
[root@localhost ~]# mysql -uroot -peGNEvAgTNn4vdLJw
修改mysql登录密码
mysql> set password=password("root");
mysql> flush privileges;
mysql> exit
再次登录mysql
[root@localhost ~]# mysql -uroot -proot
授权远程访问
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
64位 MySql安装后的密码修改步骤:
/root/.mysql_secret #安装后生成的mysql中root用户的随机密码 service mysql start #启动mysql服务 mysql -uroot -p randomp #使用随机密码登陆 >set password=password("root"); >flush privileges; >exit; |
开启远程访问权限
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; mysql>FLUSH PRIVILEGES; |