一:安装JDK
首先检测下系统是否安装jdk #rpm -qa|grep jdk
如果 显示:jdk-1.6.0_10-fcs
卸载:#rpm -e --nodeps jdk-1.6.0_10-fcs
JDK下载地址:
http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.rpm
上传 JDK到指定目录
chmod +x jdk-7u67-linux-x64.rpm
rpm -ivh jdk-7u67-linux-x64.rpm
①进入编辑profile文件
#vim /etc/profile
②在profile文件最后追加入如下内容:
export java_HOME=/usr/java/jdk1.7.0_25
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
③保存并退出,
执行如下#source /etc/profile
二:安装tomcatTomca下载地址:
http://tomcat.apache.org/download-70.cgi
下载后解压:tar -zxvf apache-tomcat-7.0.28
移动到/usr/local/tomcat7:mv apache-tomcat-7.0.28 /usr/local/tomcat7
设置目录可执行权限 chmod +x /usr/local/tomcat7
三:安装mysql
wget –c
http://dev.mysql.com/get/Downloa ... -1.rhel5.x86_64.rpm
wget –c
http://dev.mysql.com/get/Downloa ... -1.rhel5.x86_64.rpm
wget –c
http://dev.mysql.com/get/Downloa ... -1.rhel5.x86_64.rpm
rpm -ivh MySQL-server-5.6.10-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-5.6.10-1.rhel5.x86_64.rpm
rpm -ivh MySQL-devel-5.6.10-1.rhel5.x86_64.rpm
service mysql start 启动数据库
安装完成后可能无法连接数据库错误:# mysql -u root -p
Enter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
或者# mysql -u root -p password 'newpassword'
Enter password:mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
解决方法如下:
# /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost';//把空的用户密码都修改成非空的密码就行了。
mysql> FLUSH PRIVILEGES;mysql> quit # /etc/init.d/mysqld restart
# mysql -uroot -pEnter password: <输入新设的密码newpassword>
MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决
mysql> SET PASSWORD = PASSWORD('123456');Query OK, 0 rows affected (0.03 sec)
mysql> create database roger;Query OK, 1 row affected (0.00 sec)
也就是用mysql> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!
原文转自:
http://www.52itstyle.com/thread-2052-1-1.html
-------------------------
-------------------------
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。