資源描述:
《linux部署tomcat,mysql,jdk》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在學術論文-天天文庫。
1、mysql安裝1.在線安裝命令yum-yinstallmysql-server2.裝入Service啟動服務/etc/rc.d/init.d/mysqldstart或者servicemysqldrestart3.設置mysql服務開機自啟動chkconfigmysqldon4.查看mysql開機自啟動設置情況chkconfig--listmysqld?(mysqld0:off1:off2:on3:on4:on5:on6:off) ←如果2--5為on的狀態(tài)就OK5.查看當前mysql版本信息mysql--version?6.修改mysql默認編碼和sql語句執(zhí)行的最大長度執(zhí)行vi/etc/m
2、y.cnf命令在[mysqld]最后增加:default-character-set=utf8character-set-server=utf8init_connect='setnamesutf8'max_allowed_packet=50Mwait_timeout=27594000重啟mysql命令:servicemysqldrestart進入到mysql查看超時時間:showglobalvariableslike'wait_timeout';7.進入mysql中查看當前編碼mysql>showvariableslike'%character%';?8.設置訪問權(quán)限和密碼mysql>gra
3、ntallprivilegeson*.*to'root'@'%'identifiedby'admin';?mysql>grantallprivilegeson*.*to'root'@'localhost'identifiedby'admin';?mysql>flushprivileges;?9.查看當前已經(jīng)設置的訪問權(quán)限狀態(tài)mysql>selectuser,host,passwordfrommysql.user;10.重啟mysql服務servicemysqldrestart或者/etc/init.d/mysqldrestart?11.刪除mysql(安裝出錯時再執(zhí)行)yumremovemy
4、sqlmysql-servermysql-libscompat-mysql51?rm-rf/var/lib/mysql?rm/etc/my.cnf12.查看是否存在mysql(安裝出錯時再執(zhí)行)rpm-qa
5、grepmysql?//有的話繼續(xù)刪除?rpm-qlmysql???//查看文件位置13.注:重啟服務器:reboot八、JDK安裝1.將安裝包jdk-7u71-linux-x64.tar.gz拷貝到/opt/java目錄2.將包權(quán)限改成777chmod777jdk-7u71-linux-x64.tar.gz3.解壓[root@localhostjava]#tar-xvfjdk-7u71
6、-linux-x64.tar.gz4.修改解壓后的目錄的權(quán)限[root@localhostjava]#chmod-cfvR777jdk1.7.0_71/5.修改環(huán)境變量:[root@localhostjava]#vi~/.bashrcexportJAVA_HOME=/opt/java/jdk1.7.0_71exportJRE_HOME=${JAVA_HOME}/jreexportCLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexportPATH=${JAVA_HOME}/bin:$PATH如下:6.使配置的環(huán)境變量生效[root@localhostj
7、ava]#source~/.bashrc7.使這個JDK為系統(tǒng)默認JDK對于多jdk環(huán)境比較有用(如果環(huán)境是新的無需執(zhí)行下面語句)[root@localhostjava]#update-alternatives--install/usr/bin/javajava/opt/java/jdk1.7.0_71/bin/java300[root@localhostjava]#update-alternatives--install/usr/bin/javacjavac/opt/java/jdk1.7.0_71/bin/javac300[root@localhostjava]#update-alter
8、natives--install/usr/bin/jarjar/opt/java/jdk1.7.0_71/bin/jar300[root@localhostjava]#update-alternatives--install/usr/bin/javahjavah/opt/java/jdk1.7.0_71/bin/javah300[root@localhostjava]#update-alternatives-