1.在線安裝命令
yum -y install mysql-server
2.裝入Service啟動服務
/etc/rc.d/init.d/mysqld start 或者service mysqld restart
3. 設置mysql服務開機自啟動
chkconfig mysqld on
4.查看mysql開機自啟動設置情況
chkconfig --list mysqld
(mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off) ← 如果2--5為on的狀態(tài)就OK
5.查看當前mysql版本信息
mysql --version
6. 修改mysql默認編碼和sql語句執(zhí)行的最大長度
執(zhí)行vi /etc/my.cnf命令
在[mysqld]最后增加:
default-character-set=utf8
character-set-server = utf8
init_connect='set names utf8'
max_allowed_packet = 50M
wait_timeout=27594000
重啟mysql命令: service mysqld restart
進入到mysql查看超時時間:show global variables like 'wait_timeout';
7. 進入mysql中查看當前編碼
mysql>show variables like '%character%';
8. 設置訪問權限和密碼
mysql> grant all privileges on *.* to 'root'@'%' identified by 'admin';
mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'admin';
mysql> flush privileges;
9.查看當前已經(jīng)設置的訪問權限狀態(tài)
mysql> select user,host,password from mysql.user;
10. 重啟mysql服務
service mysqld restart 或者 /etc/init.d/mysqld restart
11.刪除mysql(安裝出錯時再執(zhí)行)
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
12.查看是否存在mysql(安裝出錯時再執(zhí)行)
rpm -qa|grep mysql //有的話繼續(xù)刪除
rpm -ql mysql //查看文件位置
1.將安裝包jdk-7u71-linux-x64.tar.gz拷貝到/opt/java目錄
2.將包權限改成777
chmod 777 jdk-7u71-linux-x64.tar.gz
3.解壓
[root@localhost java]# tar -xvf jdk-7u71-linux-x64.tar.gz
4.修改解壓后的目錄的權限
[root@localhost java]# chmod -cfvR 777 jdk1.7.0_71/
5.修改環(huán)境變量:
[root@localhost java]# vi ~/.bashrc
export JAVA_HOME=/opt/java/jdk1.7.0_71
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
如下:
6.使配置的環(huán)境變量生效
[root@localhost java]# source ~/.bashrc
7.使這個JDK為系統(tǒng)默認JDK對于多jdk環(huán)境比較有用(如果環(huán)境是新的無需執(zhí)行下面語句)
[root@localhost java]# update-alternatives --install /usr/bin/java java /opt/java/jdk1.7.0_71/bin/java 300
[root@localhost java]# update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.7.0_71/bin/javac 300
[root@localhost java]# update-alternatives --install /usr/bin/jar jar /opt/java/jdk1.7.0_71/bin/jar 300
[root@localhost java]# update-alternatives --install /usr/bin/javah javah /opt/java/jdk1.7.0_71/bin/javah 300
[root@localhost java]# update-alternatives --install /usr/bin/javap javap /opt/java/jdk1.7.0_71/bin/javap 300
8.查看安裝的jdk是否好用
java -version
javac -version
輸入兩條命令后,顯示的版本信息一致,則說明已經(jīng)成功
1.將tomcat安裝包apache-tomcat-7.0.57-windows-x64.zip在本地解壓后放到/usr/local目錄
2.修改解壓后的目錄的權限
[root@localhost local]# chmod -cfvR 777 apache-tomcat-7.0.57/
3.修改環(huán)境變量:
[root@localhost java]# vi ~/.bashrc
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.57
使配置的環(huán)境變量生效
[root@localhost java]# source ~/.bashrc
如圖:
4.啟動tomcat命令:
[root@localhost local]# /usr/local/apache-tomcat-7.0.57/bin/startup.sh
顯示下面信息表明啟動成功:
5. 關閉命令:
[root@localhost local]# /usr/local/apache-tomcat-7.0.57/bin/shutdown.sh
6.修改端口:
Tomcat默認端口為8080,為了防止和ATCTI端口沖突需要改為8090
修改Tomcat目錄下的conf/server.xml文件
將<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
改為<Connector connectionTimeout="20000" port="8090" protocol="HTTP/1.1" redirectPort="8443"/>
7. 加入系統(tǒng)服務:
將tomcat的系統(tǒng)自啟動文件拷貝到/etc/rc.d/init.d/目錄
修改權限:chmod 777 /etc/rc.d/init.d/tomcat
執(zhí)行命令:chkconfig --add tomcat
查看是否加入成功:chkconfig
之后啟動和關閉tomcat可以通過以下命令來操作,并且tomcat會開機自動啟動
service tomcat start
service tomcat stop
聯(lián)系客服